improving threading / osl::Condition abstraction ...
Stephan Bergmann
sbergman at redhat.com
Mon Dec 2 00:29:58 PST 2013
On 11/28/2013 07:00 PM, Michael Meeks wrote:
> + /**
> + * Warning: the Condition abstraction is inadequate for any
> + * situation where there may be multiple threads waiting on
> + * the same condition. It can only be used to synchronise
> + * interactions between two threads cf. lost wakeups in:
> + * http://www.cs.wustl.edu/~schmidt/win32-cv-1.html
> + */
Multiple threads waiting on a (monotonic) condition is not necessarily a
problem. But sure, the abstraction as-is is practically a disaster.
> The real question is: should we fix it in-place - by deprecating the
> 'set' and 'reset' methods; and adding the familiar: 'signal' 'broadcast'
> and a wait( Mutex &rMutex ) - method - preferably implemented on Windows
> using Norbert's abstraction:
>
> https://gerrit.libreoffice.org/6837
>
> or something similar / better.
>
> Or - should we deprecate it and use something else (boost?) wherever
> possible with an easy [sic] hack to replace our threading code with
> that ?
Given that threading primitives are standardized since C++11, I think it
makes more sense in the long run to deprecate and ultimately remove our
platform abstraction layer's corresponding features than to add to them.
If the Boost Thread library should already be usable in your case, I
would strongly suggest to go with it.
> PS. Stephan - any chance you can reply-to-All ? ;-)
Michael, any chance of not using reply-to-all?
Stephan
More information about the LibreOffice
mailing list