[fpc-pascal] Where is IsMultiThreaded set under Linux?

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Oct 8 22:52:17 CEST 2010


On 08 Oct 2010, at 22:45, Andrew Brunner wrote:

> On Fri, Oct 8, 2010 at 3:37 PM, Marco van de Voort <marcov at stack.nl> wrote:
>> No, but the last one might be set before the condition coupled to that last
>> one might be carried out. See Jonas' example.
> 
> The ONLY way that could happen is if the boolean happens to be set in
> a worker thread's method that still has more work to do.

That is incorrect. Even if you set the boolean only to true at the very end, problems can still occur. See e.g. http://en.wikipedia.org/wiki/Memory_barrier#An_illustrative_example for an example and explanation.


Jonas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20101008/9cc71a51/attachment.html>


More information about the fpc-pascal mailing list