From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 977927EE4B for ; Tue, 1 Oct 2013 07:01:50 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of pierre.chambart@laposte.net) identity=pra; client-ip=193.253.67.226; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="pierre.chambart@laposte.net"; x-sender="pierre.chambart@laposte.net"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of pierre.chambart@laposte.net designates 193.253.67.226 as permitted sender) identity=mailfrom; client-ip=193.253.67.226; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="pierre.chambart@laposte.net"; x-sender="pierre.chambart@laposte.net"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@smtpout.laposte.net) identity=helo; client-ip=193.253.67.226; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="pierre.chambart@laposte.net"; x-sender="postmaster@smtpout.laposte.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkkBAPdVSlLB/UPinGdsb2JhbABawhiCe4FLDgEBAQEBBg0JCRQogiUBAQV4ARALGAkWDwkDAgECAUUGDQEHAodvARIEsmMQijGPUQeEIgOeMo8G X-IPAS-Result: AkkBAPdVSlLB/UPinGdsb2JhbABawhiCe4FLDgEBAQEBBg0JCRQogiUBAQV4ARALGAkWDwkDAgECAUUGDQEHAodvARIEsmMQijGPUQeEIgOeMo8G X-IronPort-AV: E=Sophos;i="4.90,1012,1371074400"; d="scan'208";a="28629954" Received: from smtpout1.laposte.net (HELO smtpout.laposte.net) ([193.253.67.226]) by mail3-smtp-sop.national.inria.fr with ESMTP; 01 Oct 2013 07:01:49 +0200 Received: from [192.168.2.34] ([66.65.121.35]) by mwinf8502-out with ME id Xh1n1m00D0lvKC203h1onx; Tue, 01 Oct 2013 07:01:49 +0200 Message-ID: <524A573B.4030903@laposte.net> Date: Tue, 01 Oct 2013 01:01:47 -0400 From: Pierre Chambart User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130821 Icedove/17.0.8 MIME-Version: 1.0 To: Xavier Leroy CC: caml-list@inria.fr References: <524941CC.1080906@inria.fr> In-Reply-To: <524941CC.1080906@inria.fr> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Thread behaviour On 30/09/2013 05:18, Xavier Leroy wrote: > On 2013-09-27 12:10, Tom Ridge wrote: >> I have a little program which creates a thread, and then sits in a loop: >> [...] >> When I run the program I get the output: >> >> 1 >> 2 >> >> and the program then sits in the loop. > It all depends on the whim of the OS scheduler. OCaml has no control > over it. And you shoudn't expect any kind of fairness from the OS > scheduler, esp. Linux's, which gladly jettisons any pretense of > fairness in the hope of getting better throughput. Usualy, the scheduler is fair when you force all threads to run on the same processor. But I would still prefer the LWT way for doing message passing. -- Pierre