Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2006-10-24 14:35:09

On Oct 24, 2006, at 12:15 PM, Peter Dimov wrote:

> There's also an implementation by Ion Gaztañaga:
> sync/interprocess_upgradable_mutex.hpp?revision=1.4&view=markup
> in which he implements yet another Terekhov algorithm (AFAIK).

Imho Terekhov's algorithm is the way to go regarding reader/writer
priority. I've beat on this algorithm fairly heavily in my own
implementation of it, and it really performs nicely. Take a look at
this test case originally inspired by Peter:

You can ignore the move-aspects of it, and even the upgradable aspect
of it if you want. But try to get the I/O part of it working on your
system (gotoxy). Then crank up the number of readers/writers and
play with the protected section cost (vec_len). Then observe the
progress of the different kinds of threads. In my experiments no
thread is ever shut out, no matter how high the contention gets.
This is a very desirable property.


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