[clug] Semaphores and shared memory

Martin Pool mbp at sourcefrog.net
Tue Dec 9 10:11:47 GMT 2003


On  9 Dec 2003, Jepri <jepri at webone.com.au> wrote:
> I've got some chunky data files that I would like to access at the same 
> time from different programs.  I know that I can mmap the files into 
> different programs at the same time, but what's the right way (TM)  for 
> the programs to let each other know when they are updating the files?  
> Ideally I'd use mutex or something, but I'm not sure how to share these 
> between programs that do not have a common parent.  Do I have to resort 
> to some kind of formal IPC like SysV shared memory ?

Just lock the file.  man lockf.

-- 
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux/attachments/20031209/741c3f5e/attachment.bin


More information about the linux mailing list