Boost logo

Boost :

From: Thomas Sondergaard (ts_news1_at_[hidden])
Date: 2007-06-02 02:23:57


Andy wrote:

> If I use a static engine, I need to protect it with a mutex. This is
> not optimal because there is the overhead of locking and unlocking the
> mutex. Some people would rather have a static engine per thread using
> thread local storage. This still requires one to link with
> Boost.Thread. I created the uuid::create(Engine) function (great advice
> from this list) so that users could do whatever they want (static engine
> per thread, use thread local storage,...).

Perhaps you could write a CAS/lock-free random number generator. I have
no idea how difficult that would be, I just recently stumbled over the
CAS/lock-free threading technique myself.

Thomas


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