Solved

Force file write delay ( a special filesys using physical memory )

Posted on 1997-08-03
3
206 Views
Last Modified: 2013-12-26
Is there any way to force write delay for specical files in
UNIX system ? It should be something like
fopen(myfilename, rw, "Not_Write_To_HardDisk").

I meant if the system programmer know the file(s) is a frequently used, frequently changed ( not necessary to flash to HardDisk ) one, can he do something to interfere with the file system swapping ?

Or can we allocate a small physical memory area, setup a filesystem on it, then let several programs read/write data file from/to it. That will just like a RAM disk in PC, a small never_swap_out file system.

I think it will be a fast & easy way for several processes to share some public data. Those processes may be designed by different programmers, for different purpose. But no one need to worry about the share memory stuff,  and  file read/write/lock are easy to handle.

PS, it's very useful for hot imgs/pages in web server. Can proxy server do the job (cache specific file in physical memory) ?

Any sugguestion or successful story ?  Thanx.
0
Comment
Question by:sunjohn
  • 2
3 Comments
 

Author Comment

by:sunjohn
ID: 1294166
Adjusted points to 100
0
 
LVL 4

Accepted Solution

by:
jos010697 earned 100 total points
ID: 1294167
Have a look at mmap() and munmap(). Those functions
map a region of memory onto a file. The file is used as
swap space _whenever necessary_. If there' enough
memory available, all of the mapped region stays in core.

Simply map a (existent) file to memory and let all the processes
do whatever they want to do with it; they all treat it as if
it wrer just part of their (virtual) address space.

kind regards,

Jos aka jos@and.nl
0
 

Author Comment

by:sunjohn
ID: 1294168
Thanks a lot.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now