Version française
Home     About     Download     Resources     Contact us    
Browse thread
Threads Scheduling
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jake Donham <jake@d...>
Subject: Re: [Caml-list] Threads Scheduling
On Tue, Apr 13, 2010 at 1:33 PM, Gregory Malecha
<gmalecha@eecs.harvard.edu> wrote:
> It seems like it should work, but it doesn't work if the function f doesn't
> terminate. It seems to be running everything serially. I know that threads
> aren't actually parallel, but I thought they were preemptive in which case
> it seems like this should work. Does anyone know what I did wrong here?

You have a deadlock---the main thread has the mutex locked and won't
unlock it until the condition is signaled; neither of the other
threads will signal the condition until the mutex is unlocked. There
is no reason to lock/unlock the mutex in the two child threads.

Jake "crossing fingers"