[m-dev.] Is this a semaphore bug or comprehension failure on my part?
Ralph Becket
rbeck at microsoft.com
Tue May 15 00:54:39 AEST 2001
Oh how embarrassing... It turns out that semaphore__signal//1
encourages the scheduler to transfer control to a waiting thread
then and there. Hence if you reorder the code to say
io__format("relinquishing fork...\n", []),
semaphore__signal(Sem),
then the output arrives in a sensible order.
D'oh!
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list