From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id B5A4B7EE4B for ; Mon, 30 Sep 2013 17:12:45 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of tom.j.ridge@googlemail.com) identity=pra; client-ip=209.85.220.43; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="tom.j.ridge@googlemail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of tom.j.ridge@googlemail.com designates 209.85.220.43 as permitted sender) identity=mailfrom; client-ip=209.85.220.43; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="tom.j.ridge@googlemail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-pa0-f43.google.com) identity=helo; client-ip=209.85.220.43; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="postmaster@mail-pa0-f43.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnwCAKKTSVLRVdwrlGdsb2JhbABahBHCIggWDgEBAQEHCwsJEiqCJQEBBUABATcBDwEKCw0uIhIBBQEcBhOHcwEDD59SiwyEUAEFhAgKGScNiWQGk3qYApAPGCmBYoJsOw X-IPAS-Result: AnwCAKKTSVLRVdwrlGdsb2JhbABahBHCIggWDgEBAQEHCwsJEiqCJQEBBUABATcBDwEKCw0uIhIBBQEcBhOHcwEDD59SiwyEUAEFhAgKGScNiWQGk3qYApAPGCmBYoJsOw X-IronPort-AV: E=Sophos;i="4.90,1008,1371074400"; d="scan'208";a="34937594" Received: from mail-pa0-f43.google.com ([209.85.220.43]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 30 Sep 2013 17:12:43 +0200 Received: by mail-pa0-f43.google.com with SMTP id hz1so5966696pad.30 for ; Mon, 30 Sep 2013 08:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=rS7ezqjCPeWwLU3Z/fWICXptN5+M8ygptctFor4XEfE=; b=AlTJeNg3EIWjyaIuPLNbN4UVzD6k+MvJFymZxry11NRFD6MskVA92H/CjOSaPrT97x ZLTG3ZVsXbyzlRg8+tGk9Qq0q3OCtcSWX5PSIopGCCq+t9ZHcjVaWF3zLoGb+6+CS3Nu BL/OkUR0aBk4I1Eb+iAao9V/6+xopK4ZwITudcjrR8rTr6qGanWA5uh6ERuXALxUudW3 8aJhAGPjasnL1RErq4ISwS/prFwVXYvmzljzq2Nd3R6n0xC2jllGF6llbSKZq2+4o9VY JRG6CH+XOBjOxUzQ8qfnggFL9qGrdGwh4LtKtHnmWH9Vf8O+HJATsdIHosWqu4PXWlsT EavA== X-Received: by 10.68.212.37 with SMTP id nh5mr24423452pbc.16.1380553963446; Mon, 30 Sep 2013 08:12:43 -0700 (PDT) MIME-Version: 1.0 Sender: tom.j.ridge@googlemail.com Received: by 10.70.79.136 with HTTP; Mon, 30 Sep 2013 08:12:23 -0700 (PDT) In-Reply-To: <524941CC.1080906@inria.fr> References: <524941CC.1080906@inria.fr> From: Tom Ridge Date: Mon, 30 Sep 2013 16:12:23 +0100 X-Google-Sender-Auth: DfnWqyTnNN-0r4GsZuGfdZKqO6A Message-ID: To: Xavier Leroy Cc: caml-list Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] Thread behaviour On 30 September 2013 10: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. > > On my machine (OCaml 4.01.0, Ubuntu 12.04 LTS), I sometimes see what > you see, and sometimes I see the expected output: > > 1 > 2 > 3 > hello > 4 > > 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. > Ah! You are saying that the problem (maybe) lies with the Linux scheduler. This had never occurred to me. Probably because I assumed the Linux phrase "completely fair scheduler" meant something (although admittedly, I never tried to find out what). Thanks