[mercury-users] multi threading problem

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Dec 4 14:28:52 AEDT 2002


On 04-Dec-2002, Pieter Laeremans <pieter at kotnet.org> wrote:
> I've got a multi threading problem.
> 
> From the following code I would suspect that I would print some lines
...
> But it does not.

I think it does... you just need to wait for it.
You didn't wait long enough ;-)

> My terminal stays blank, and the program isn't
> consuming any cpu. Does anyone has some explanation for this ?

Call io__flush_output after io__write, or ensure that the output is
terminated by a newline (or both).  Otherwise the output will only make
it to the terminal when the output buffer fills up, which at the rate
of about 10 characters output per second (due to all those calls to "sleep")
will probably take quite a few minutes.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list