Boost logo

Boost :

Subject: Re: [boost] boost::interprocess
From: Artyom (artyomtnk_at_[hidden])
Date: 2010-04-09 09:06:30


>
> How can I synchronize mutlipe read/single write on a file
> available on
> a shared folder ?

See: http://www.boost.org/doc/libs/1_39_0/doc/html/interprocess/synchronization_mechanisms.html#interprocess.synchronization_mechanisms.file_lock

But you should be really careful with API is used for file locking.
I mean if you run on Linux you should be sure you are using fcntl and
you do not share locks between threads etc...

See section "Caution: Synchronization limitations"

> The multiple read/write need to be synchronized b/w
> different
> processes running on different machine.
>

But generally speaking this is **bad idea**, shared file systems are not
designed for IPC... Locks over shared file systems tend to be unreliable
and tricky...

So be very careful with it.

Artyom

      


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk