views:

33

answers:

1

Hi

I would like to know if someone has some idea or feedback about sharing data between thread or processes ( through a shared memory segment ). I was thinking about passing across the threads/process some ownership object ( through a pipe/ synchronized queue ). The only thread that can access data are the one owning the ownership of that object( or memory area ). If one thread wants to access an object that is own elsewhere then it gets an exception or it blocks . Any idea how to cleanly implement this protocol ?

+1  A: 

If you can extend your possible languages to include C++, Boost.Interprocess supports portable shared memory.

You should be able to implement the blocking you describe by combining this with condition variable in Boost.Thread.

Steve Townsend
Yes sounds like a very good starting point indeed. Are you aware of any documents/software describing this kind of behaviour ( actually i got the idea looking at a video from MSFT about their next OS generation called singularity )
Dave