Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Native threads under Debian 3.0r0
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Markus Mottl <markus@o...>
Subject: Re: [Caml-list] Native threads under Debian 3.0r0
On Wed, 04 Sep 2002, Jacques Garrigue wrote:
> In bytecode "something_to_do" is used, and checked pretty often:
> at every function call and every loop iteration.

Ok.

> However, this would mean too much overhead for native code, so switching
> is only checked when the GC is called.

Actually, calling the GC manually does not make any difference. The only
thing that helps is calling "Thread.yield" in the infinite loop.

> To make it work even on slowly allocating programs, the young generation
> is declared "full" every once in a while, but there must still be some
> allocation for it to happen.

I see. So if the GC doesn't really have to do any work, it will also
not switch threads even when called manually.

> So the answer is: a native code thread should be allocating some data,
> otherwise it cannot be interrupted. The problem does not exist for
> bytecode.

The main consideration is obviously native code performance. OTOH, some
people might want to guarantee that their threads never get stuck. I
don't know what solution would be useful for them. Maybe some runtime
or command-line switch that trades efficiency against such scheduling
problems.

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners