Le 30/12/12 21:25, Fredrik Orderud a écrit :
The single references I have are at http://home.roadrunner.com/~hinnant/Questions:
* Are you aware of any documentation for the shared_mutex locking algorithm? In particular, I'm curious about the precise workings of exclusive_waiting_blocked.
http://home.roadrunner.com/~hinnant/bloomington/shared_mutex.html, www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2406.html and http://home.roadrunner.com/~hinnant/mutexes/locking.html
The implementation in Boost.Thread is a little bit different. Now that you request for exclusive_waiting_blocked, it seems to be used to give priority to the first exclusive ownership as as soon as it is set on lock operations, all the shared and upgrade operations are blocked. Anthony could you confirm?
The win32 implementation is not complete. I think we should concentrate on the generic implementation (located now in the pthread directory but that doesn't depends at all on pthread) and then go to a specific and possible more efficient implementation on windows or pthread.* The win32 imp. appears to be "better" in that it's lockless (except for semaphores), whereas pthread has an internal mutex protecting all methods (with condition variables). Are there any specific reasons why the pthread imp. isn't also lockless?
I think it could be beneficial to first take some steps towards unifying/deduplicating the shared_mutex implementations before adding more "priority policy" complexity into the mix.