Boost logo

Boost :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2007-09-27 06:42:11


Hi to all,

  Recently some bug reports were issued against Boost.Interprocess'
condition variable. Since my multithreading skills are limited at best,
I was wondering if Boost.Thread developers/threading experts would like
to help on rewriting the condition variable.

Let me explain some issues:

Native vs. emulated condition vars
----------------------------------

Some POSIX systems have process-shared condition variables. In those
systems interprocess_condition is a wrapper around pthread_cond_t. In
the rest of platforms (including Windows and MacOS) an emulated
condition variable is used.

Emulated condition vars
-----------------------

Emulated condition variables store integers and use atomic operations
and busy waits/yields() to emulate process-shared condition variables.
Reasons to use integers and busy waits are:

-> Independent from address mapping.

-> The condition variable should be compatible with memory mapped files.
A user can map a file, build a condvar, unmap the file, reboot the
system, map it again and continue working.

Since there is no atomic operations library in Boost I use my own atomic
operations (taken from apache):

http://svn.boost.org/svn/boost/trunk/boost/interprocess/detail/atomic.hpp

The emulated condition variable is here:

http://svn.boost.org/svn/boost/trunk/boost/interprocess/sync/emulation/interprocess_condition.hpp

So if you are a thread expert, Boost.Interprocess users and I need your
help to write a robust process-shared condition variable emulation.

Regards,

Ion


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