Re: [Boost-users] [Atomic] [Tread] Proposal for Synchronized<T>
Hi,
I've been working already on a synchronized_value class that is in trunk [1]. I plan to merge it to release branch as soon as I have finished the tests and the documentation. You can see some examples in [2] and [3].
I've take a look to your class and I think my class provides everything yours provide.
My class allows in addition to lock several synchronized values using
Please could you compare your class to mine and let me know what do you
Surely your version has been given more thought. the deadlock free lock algorithm as e.g. I did not understand the unique_synchronize part, though. think? I can't see any flaw right now, but I'm still playing with it. If anything shows up I'll let you know. Thanks !
Le 20/02/13 03:08, Gabriel Bizzotto a écrit :
My class allows in addition to lock several synchronized values using the deadlock free lock algorithm as e.g.
I did not understand the unique_synchronize part, though.
synchronize() returns a strict_lock_ptr which is something like a
lock_guard that is not Lockable.
unique_synchronize() returns a unique_lock_ptr which is something like a
unique_lock (Lockable) and can be used with dead-lock free algorithms.
This facility can be used when locking several synchronized_value
instances to avoid dead-lock.
this dead-lock algorithm is used e.g. to define the assignment operation
as follows
synchronized_value& operator=(synchronized_value const& rhs)
{
if(&rhs != this)
{
unique_lock
participants (2)
-
Gabriel Bizzotto
-
Vicente J. Botet Escriba