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
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.