From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr 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 A0FE87EE4B for ; Wed, 2 Oct 2013 13:52:27 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of berenger@riken.jp) identity=pra; client-ip=134.160.33.161; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="berenger@riken.jp"; x-sender="berenger@riken.jp"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of berenger@riken.jp designates 134.160.33.161 as permitted sender) identity=mailfrom; client-ip=134.160.33.161; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="berenger@riken.jp"; x-sender="berenger@riken.jp"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of postmaster@postman.riken.jp designates 134.160.33.161 as permitted sender) identity=helo; client-ip=134.160.33.161; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="berenger@riken.jp"; x-sender="postmaster@postman.riken.jp"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqABADIITFKGoCGhnGdsb2JhbABYgz+vD5JYgS4OAQEBAQEICwkJFCiCJQEBBAE4NgoRCxgJBBIIBwkDAgECATMBERMGAgEBDodiAwkFAQyzIAMQiWSPWBaEDQOJN45IgS+Tfw X-IPAS-Result: AqABADIITFKGoCGhnGdsb2JhbABYgz+vD5JYgS4OAQEBAQEICwkJFCiCJQEBBAE4NgoRCxgJBBIIBwkDAgECATMBERMGAgEBDodiAwkFAQyzIAMQiWSPWBaEDQOJN45IgS+Tfw X-IronPort-AV: E=Sophos;i="4.90,1018,1371074400"; d="scan'208";a="35245257" Received: from postman1.riken.jp (HELO postman.riken.jp) ([134.160.33.161]) by mail2-smtp-roc.national.inria.fr with ESMTP; 02 Oct 2013 13:52:24 +0200 Received: from postman.riken.jp (postman1.riken.jp [127.0.0.1]) by postman.riken.jp (Postfix) with SMTP id BAD352588002 for ; Wed, 2 Oct 2013 20:52:22 +0900 (JST) Received: from fbrs-iMac.local (usr013.bb802-01.ual.im.wakwak.ne.jp [219.121.104.207]) by postman.riken.jp (Postfix) with ESMTPA id B2C9B32A0085 for ; Wed, 2 Oct 2013 20:52:19 +0900 (JST) Message-ID: <524C08F3.2090500@riken.jp> Date: Wed, 02 Oct 2013 20:52:19 +0900 From: Francois Berenger User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: caml-list@inria.fr References: <524941CC.1080906@inria.fr> <524A573B.4030903@laposte.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.10.2.113914 Subject: Re: [Caml-list] Thread behaviour On 10/2/13 7:37 PM, Wojciech Meyer wrote: > Agreed here, but it does not preclude of using very lightweight > alternative based on system threads like parmap Just for the record, Parmap is fork-based, not thread-based. > or functory for the > parts have a high degree of parallerism. (and of course only if your > program allows to do this) > > > On Tue, Oct 1, 2013 at 6:01 AM, Pierre Chambart > > wrote: > > 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 > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > >