Browse thread
Why 'Graphics.wait_next_event' doesn't reply anymore ?
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Oliver Bandel <oliver@f...> |
| Subject: | Re: [Caml-list] Why 'Graphics.wait_next_event' doesn't reply anymore ? |
Zitat von Julien Moutinho <julien.moutinho@gmail.com>: > On Sun, Nov 11, 2007 at 05:48:34PM +0100, Oliver Bandel wrote: > > [...] > > This code looks ugly. > I've just noticed the id := Some (Thread.create run ()) > coupled with the [while !id <> None do] in run: [...] I didn't saw this code in the program that I'm talking about :-) [...] > > > Why? > > [...] > > It forces calls to the scheduler all too often. > > And it does it at three places. And in the print-loop > > it clals it every time! > Are you sure? Yes! And the loop in the main-thread, that does nothing else but calling Thread.yield is even worse! Two busy threads running wild against one most-of-the-time sleeping thread... ...and always these Thread.yield-calls, that only add unnecessary business... Ciao, Oliver