From: Jake Donham <jake@donham.org>
To: gmalecha@cs.harvard.edu
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Threads Scheduling
Date: Tue, 13 Apr 2010 13:54:48 -0700 [thread overview]
Message-ID: <p2lc7e4e9f1004131354pb9ccf63ew7992164d86bea19b@mail.gmail.com> (raw)
In-Reply-To: <n2j6d110d191004131333xa28313a3sb4d03b191099c8fd@mail.gmail.com>
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"
next prev parent reply other threads:[~2010-04-13 20:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-13 20:33 Gregory Malecha
2010-04-13 20:54 ` Jake Donham [this message]
2010-04-13 21:04 ` [Caml-list] " Daniel Bünzli
2010-04-13 21:56 ` Gregory Malecha
2010-04-14 8:40 ` Philippe Wang
2010-04-14 18:18 ` Goswin von Brederlow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=p2lc7e4e9f1004131354pb9ccf63ew7992164d86bea19b@mail.gmail.com \
--to=jake@donham.org \
--cc=caml-list@yquem.inria.fr \
--cc=gmalecha@cs.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox