[m-dev.] for review - new stuff for the extras directory.

Thomas Conway conway at cs.mu.OZ.AU
Wed Mar 1 09:35:27 AEDT 2000


On Tue, Feb 29, 2000 at 09:11:11PM EST, Ralph Becket wrote:
> > From: Thomas Conway [mailto:conway at cs.mu.OZ.AU]
> >
> > > :- pred loop_forever(io__state, io__state).
> > > :- mode loop_forever(di, uo) is det.
> > > 
> > > loop_forever --> yield, loop_forever.
> > 
> > Hmmm, it looks like my reply turned into a more detailed explanation
> > of my semantics of coroutining than I set out for, but never mind...
> > I was just going to point out that your loop_forever (not having seen
> > how you use it yet), is unlikely to do anything useful.
> 
> Indeed, it doesn't do anything useful.  I was making a (daft)
> assumption after looking at your code when I should have asked a
> question :)
> 
> In your code, you wrote:
> 
> main -->
> 	new(Lock), signal(Lock),
> 	new(forks(yes, yes, yes, yes, yes), ForkGlob),
> 	spawn(philosopher(plato, Lock, ForkGlob)),
> 	spawn(philosopher(aristotle, Lock, ForkGlob)),
> 	spawn(philosopher(descartes, Lock, ForkGlob)),
> 	spawn(philosopher(russell, Lock, ForkGlob)),
> 	      philosopher(sartre, Lock, ForkGlob).

Actually, when I looked again at the engine, I realised that the
implementation doesn't quite match up with the specification!
The engine doesn't wait until there are no other runnable threads
before exiting when main returns. :-(

Thomas
-- 
 Thomas Conway )O+     Every sword has two edges.
     Mercurian            <conway at cs.mu.oz.au>
--------------------------------------------------------------------------
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