Boost logo

Boost :

From: Jody Hagins (jody-boost-011304_at_[hidden])
Date: 2005-06-10 02:52:06

On Fri, 10 Jun 2005 07:03:58 +0200
Ion Gaztañaga <ion_g_m_at_[hidden]> wrote:

> Hi Jody,
> Shmem null mutex was just a fast implementation mainly to avoid
> mutex
> overhead with shmem machinery when used with non-shared memory
> buffers, so I if boost::thread, accepts a null mutex, I would happily
> use that. I haven't checked your patches, but I would expect a zero
> overhead mutex, regarding its size (eliminated using empty base
> optimization) and code generation (lock and unlock are empty
> functions).

I think it satisfies your requirement, but remember when using it with a
lock (e.g., scoped_lock), the lock itself is not empty, because it has
to preserve the requirements on the lock (e.g., knowing if it is in a
locked state).

Also, as noted earlier, calling notify_one() and notify_all() on the
condition incur overhead (currently), even when used in conjunction with
a null_mutex.

Boost list run by bdawes at, gregod at, cpdaniel at, john at