Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] caml_callback_depth : byterun + vmthreads
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: [Caml-list] caml_callback_depth : byterun + vmthreads
Hi,

I found this bit of code in vmthreads/scheduler.c:

/* Don't allow preemption during a callback */
if (callback_depth > 1) return curr_thread->retval;

I've done some grepping, and I can find one instance of
[caml_]callback_depth++ (as far as I can tell, this is done once
only), and two instances of [caml_]callback_depth--. These are both in
byterun/interp.c. No where else is this value modified that I can
find, which has got me baffled.

It is the check above that is killing my OS (it never schedules
another thread). This also happens randomly.

Can some one please explain what the hell is going on?

Jonathan