From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2006-06-02 08:26:38
Vladimir Frolov wrote:
>I have finished implementation of Lwsync library, which contains two
>patterns to organize synchronization on concurrent environment. I
>would like to propose to include this library into Boost.
>Lwsync library can be mapped on any threading facilities and by
>default it is mapped on Boost.Thread ones.
>Is there any interest in this library?
Although we have a quite a few concurrency libraries in the vault and in
development, I always think that each one provides an interesting
Just one comment about yours:
>typedef monitor<std::vector<int> > monitor_vector_t;
>bool is_not_empty(const std::vector<int>& test_vector)
> return !test_vector.empty();
> monitor_vector_t::accessor vector_access =
> // Do something with non-empty vector here.
I think wait_for() should return a lock object on the monitor's
resource. Otherwise, the vector could be emptied again before thread 1
gets to execute anything. (Only each individual access is locked in your
Generally, there should be a way to obtain a lock for a resource that
outlasts a single call.
If this is implemented as I guess it is, you might also suffer from the
not clearly defined temporary destruction semantics.