Solved

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

Posted on 1997-08-03
3
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 47
mixString challenge 36 134
x-bar in Google Sheets 2 96
"Black Box" Testing of Control System Software 2 96
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…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.

733 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