From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p23NO5QJ004319 for ; Fri, 4 Mar 2011 00:24:05 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtkBAK6xb03RVdg2kGdsb2JhbACEKpQFMY1/CBUBAQEBCQkMBxEEIaNQiWk8gh2FHi+IWwEBAwWBIoNEdgSFGocShlqBfTo X-IronPort-AV: E=Sophos;i="4.62,260,1297033200"; d="scan'208";a="101219992" Received: from mail-qw0-f54.google.com ([209.85.216.54]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 04 Mar 2011 00:24:00 +0100 Received: by qwj8 with SMTP id 8so1808299qwj.27 for ; Thu, 03 Mar 2011 15:23:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=PkzhljZqQtsx30SwyJQKGcqKjvxGMK7fLUJvJ30l1lc=; b=V/3n60WpA5S21rrLEj4ggWCtZgX+UnAiynOxylR4XDV+JytZBflo5K9KOwmrWv2THw 8YEn5TB6vZsQ8hN6sb2+8XzgnUbh4/PP3QDATpYUFcPBkX2q4wh+ZzKNZT5XIt8YSsPb SUjuIFMeJCpiCTLzkD4bxyDHspZoXVgSDsG3o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=sIK+/ZGUjXE6K8crxE1khAPFIpPX4hXumSeC+irka8e++NoaUiRw8460WW7T7MxTLW OXr7W4egI1Pot11SOKR8g7Pm6/p47wr59cLXQVMq4R8+cZw1XGhu9BjGJp/p8tnkQeLO l3pY5KVtD6L/8XWR5/691BG6YR5egtZ+TkBrE= MIME-Version: 1.0 Received: by 10.229.82.8 with SMTP id z8mr1542722qck.108.1299194638544; Thu, 03 Mar 2011 15:23:58 -0800 (PST) Received: by 10.229.102.7 with HTTP; Thu, 3 Mar 2011 15:23:58 -0800 (PST) In-Reply-To: References: Date: Thu, 3 Mar 2011 18:23:58 -0500 Message-ID: From: Niki Yoshiuchi To: caml-list@inria.fr Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p23NO5QJ004319 Subject: Re: [Caml-list] Using C threads Yes, I have (you can't use caml_c_thread_register() without it). However it appears that the flag doesn't run the code in the module. Nor does opening the module - only using the module seems to force the 'let _ =' code to run. Also, I got around the hanging caml_c_thread_register() problem by adding a select() call in the function that calls pthread_create(). On Thu, Mar 3, 2011 at 6:03 PM, Dmitry Bely wrote: > On Fri, Mar 4, 2011 at 1:16 AM, Niki Yoshiuchi wrote: >> I figured it out so I'm posting it here for reference. >> caml_c_thread_register() attempts to get the master lock, which >> involves dereferencing a pointer.  That pointer is initialized by the >> Thread module.  However if the OCaml code doesn't use the Thread >> module > > Have you specified -thread compiler option? Is it mandatory when using > system threads. > > - Dmitry Bely > > > -- > Caml-list mailing list.  Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > >