Boost logo

Threads-Devel :

Subject: Re: [Threads-devel] RFC: 1st pthread shared_mutex refactoring patch
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2013-01-07 17:47:56


Le 07/01/13 20:32, Fredrik Orderud a écrit :
> The attached patch is intended as a 1st step towards separation of the
> "locking policy" parts from the "synchronization" parts of
> shared_mutex. This separation is achieved by moving state_data member
> checks and manipulation into new methods in state_data. The separation
> is currently only done for exclusive and shared locking, but I will
> complete the separation to also cover upgrade locking if there is
> consensus that this is a good strategy. state_data can then be
> encapsulated with all data members private.
>
> Advantages of the separation:
> * Simplify implementation of different locking prioritization
> policies: Only requires reimplementation of state_data, with
> (hopefully) no changes to the outer shared_mutex class.
> * Simplify implementation of "lock-free" synchronization (as in win32
> counterpart): Can be done in shared_mutex without touching the
> "locking policy" logic in state_data.
>
> Any comments or feedback will be highly appreciated.
>
>
Thanks Fredrik for the patch. I think It goes on the good direction. Do
you mind to finish the upgrade part before I apply it?

Best,
Vicente


Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk