Solved

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

Posted on 1997-08-03
3
219 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

914 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

19 Experts available now in Live!

Get 1:1 Help Now