Boost logo

Boost :

Subject: [boost] [thread] Is there interest in shared_lock_prioritized?
From: Antony Polukhin (antoshkka_at_[hidden])
Date: 2013-02-20 01:00:45


I've got a very basic implementation and tests of
shared_lock_prioritized, that can be used like that:

// Events are written down in order of
// their execution in different threads

shared_lock_prioritized<2 /*priorities count*/ > lock;

// thread #1
// Lock with minimal priority

// thread #2
// Lock with minimal priority

// thread #3
// Lock for writing with priority
// greater than locks of threads 1 and 2
// Waits till already acquired locks in #1 and #2 finish
// and then writes

// thread #4
// Will wait till thread #3 finishes, only then acquire lock

Such shared lock gives us ability to manage order/priority of different
lock attempts, we can make write locks have bigger priority that read
locks, have multiple priorities writes (ordered write locks) and so

Is there an interest in it?

Best regards,
Antony Polukhin

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