[m-dev.] Is this a semaphore bug or comprehension failure on my part?

Ralph Becket rbeck at microsoft.com
Tue May 15 02:52:31 AEST 2001


> What grade are you running this in?

If I compile it with GRADEFLAGS = --grade hlc.gc.par
then I get the following:

Plato is thinking
Aristotle is thinking
Descartes is thinking
Descartes has acquired fork 2
Descartes has acquired fork 3
Descartes is eating
Calvin is thinking
Hobbes is thinking

and the program exits.  Compiling with GRADEFLAGS = --grade asm_fast.gc
I get nothing at all before the program exits.

> For grade hlc.gc.par, I think there is a bug in the current
implementation
> where if the main thread exits, then it calls exit() which will
> terminate all the other threads.  This is alluded to in the following
> comment in the code for ME_create_thread():

I agree - that's probably a bug.  It's not a big deal, though.

- Ralph
--------------------------------------------------------------------------
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