From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 3C1ACBC57 for ; Tue, 13 Apr 2010 22:55:10 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AowCAHp3xEvRVdQ0kGdsb2JhbACPZotaCBUBAQEBCQkMBxEDH65xhiyIewEBAwWCVoIyBIMniUKBag X-IronPort-AV: E=Sophos;i="4.52,199,1270418400"; d="scan'208";a="60655080" Received: from mail-vw0-f52.google.com ([209.85.212.52]) by mail4-smtp-sop.national.inria.fr with ESMTP; 13 Apr 2010 22:55:09 +0200 Received: by vws6 with SMTP id 6so113675vws.39 for ; Tue, 13 Apr 2010 13:55:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:received:message-id :subject:to:cc:content-type; bh=nS6AwuoNbiRGohTGWo+15x6+nrkykn2JVlUFl+xlpmE=; b=fBxLo1XbaRXASrw8Yx7SFLwSA6U9KKvmXphwgC/MlVU2a1+5wKWynojgRJ5qE6ltKN Xsex7D/RgYUtFrJIPJeSD6oMOtDRQcUv9Dg0CGHFYh2cQsAV+7fe6/V0NduZeYn280ip h8tfvmF+F3d/qFPxjLgjP/zlQ9aZgMP2bNsiM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=o04OtGEitLHXjMAfGW3YqGQuW2G2l1jws57rgcbbcxEn7nmG1IwtMPDrenDjs4EG76 0PKfYjCWfv/tVQ/jDblnpSAZwow1dffYLr6WZJEIH8zBTdzxNTejXgqfrp7bC4H9+zHg qXIWAMqI5UuatYttoz858n47Dcnld1PL6Nl0Q= MIME-Version: 1.0 Sender: jake.donham@gmail.com Received: by 10.220.46.138 with HTTP; Tue, 13 Apr 2010 13:54:48 -0700 (PDT) In-Reply-To: References: From: Jake Donham Date: Tue, 13 Apr 2010 13:54:48 -0700 X-Google-Sender-Auth: 81f22da38d2be7bd Received: by 10.220.107.148 with SMTP id b20mr3300545vcp.210.1271192108375; Tue, 13 Apr 2010 13:55:08 -0700 (PDT) Message-ID: Subject: Re: [Caml-list] Threads Scheduling To: gmalecha@cs.harvard.edu Cc: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; threads:01 threads:01 wrote:01 terminate:01 caml-list:01 eecs:03 seems:03 seems:03 mutex:03 mutex:03 parallel:05 tue:06 thread:06 apr:06 function:08 On Tue, Apr 13, 2010 at 1:33 PM, Gregory Malecha 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"