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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id B8A017EE4B for ; Wed, 2 Oct 2013 13:58:52 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of wojciech.meyer@gmail.com) identity=pra; client-ip=74.125.82.41; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="wojciech.meyer@gmail.com"; x-sender="wojciech.meyer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of wojciech.meyer@gmail.com designates 74.125.82.41 as permitted sender) identity=mailfrom; client-ip=74.125.82.41; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="wojciech.meyer@gmail.com"; x-sender="wojciech.meyer@gmail.com"; 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@mail-wg0-f41.google.com) identity=helo; client-ip=74.125.82.41; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="wojciech.meyer@gmail.com"; x-sender="postmaster@mail-wg0-f41.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgoCADcJTFJKfVIpm2dsb2JhbABYgz9Srj2KFIhEgRAIFg4BAQEBAQYLCwkUKIIlAQEEAUABGxILAQMBCwYFCw0NGgciAREBBQEKAREGExKHYQEDCQYMnmCMUoMKhB4KGScDCgZeiQABBQyPQQQHhCMDl3+BL45hGCmCZYFqOw X-IPAS-Result: AgoCADcJTFJKfVIpm2dsb2JhbABYgz9Srj2KFIhEgRAIFg4BAQEBAQYLCwkUKIIlAQEEAUABGxILAQMBCwYFCw0NGgciAREBBQEKAREGExKHYQEDCQYMnmCMUoMKhB4KGScDCgZeiQABBQyPQQQHhCMDl3+BL45hGCmCZYFqOw X-IronPort-AV: E=Sophos;i="4.90,1018,1371074400"; d="scan'208";a="28830496" Received: from mail-wg0-f41.google.com ([74.125.82.41]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 02 Oct 2013 13:58:52 +0200 Received: by mail-wg0-f41.google.com with SMTP id l18so6262794wgh.0 for ; Wed, 02 Oct 2013 04:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=HHoWxlNdEKY7bIwLoFgnunsS/6iQEdzH5zpzCKcliAo=; b=sKtcntIbyEEMDnJfzVhf8D1jOj3gODS42eq1KFL2HRCOroe0tAQvfYsqCCOX+nZYn7 IyNITimkBKmQsZtf3j8HT1CSofvNZJLVfh3mTqM2TA2Jl+EGQ30mJShZUD4kOjZPfFaC HQoN6wHeCf2NOU9P8/4rOltk40x/oEJNn8+xlKIyXAjwy3t4Xj8pDYk/54YvsBijBKj7 HCB8rJqo+0yQltq6euyV7TIUrKm83qEgLplw0HQIR+miZBp8J/Y9WAFwRW3IGiCkfCX4 /QAbuaMSa3JLsWYDCCaFrl8jDhg3Mg4KFHEZIjI02HwuMzhQCKG0eskAfDd6LakILHBi rGTg== MIME-Version: 1.0 X-Received: by 10.194.93.105 with SMTP id ct9mr1900809wjb.6.1380715131846; Wed, 02 Oct 2013 04:58:51 -0700 (PDT) Received: by 10.216.255.143 with HTTP; Wed, 2 Oct 2013 04:58:51 -0700 (PDT) In-Reply-To: <524C08F3.2090500@riken.jp> References: <524941CC.1080906@inria.fr> <524A573B.4030903@laposte.net> <524C08F3.2090500@riken.jp> Date: Wed, 2 Oct 2013 12:58:51 +0100 Message-ID: From: Wojciech Meyer To: Francois Berenger Cc: Caml List Content-Type: multipart/alternative; boundary=047d7bb03e78f847dc04e7c0caba Subject: Re: [Caml-list] Thread behaviour --047d7bb03e78f847dc04e7c0caba Content-Type: text/plain; charset=ISO-8859-1 Oh yes! Thanks. On Wed, Oct 2, 2013 at 12:52 PM, Francois Berenger wrote: > 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 >> >> >> > > -- > 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 > --047d7bb03e78f847dc04e7c0caba Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Oh yes! Thanks.


On Wed, Oct 2, 2013 at 12:52 PM, Francois Berenger= <berenger@riken.jp> wrote:
On 10/2/13 7:37 PM, Wojcie= ch 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
<pierre= .chambart@laposte.net <mailto:pierre.chambart@laposte.net>> w= rote:

=A0 =A0 On 30/09/2013 05:18, Xavier Leroy wrote:
=A0 =A0 =A0> On 2013-09-27 12:10, Tom Ridge wrote:
=A0 =A0 =A0>> I have a little program which creates a thread, and the= n sits in
=A0 =A0 a loop:
=A0 =A0 =A0>> [...]
=A0 =A0 =A0>> When I run the program I get the output:
=A0 =A0 =A0>>
=A0 =A0 =A0>> 1
=A0 =A0 =A0>> 2
=A0 =A0 =A0>>
=A0 =A0 =A0>> and the program then sits in the loop.
=A0 =A0 =A0> It all depends on the whim of the OS scheduler. =A0OCaml ha= s no control
=A0 =A0 =A0> over it. =A0And you shoudn't expect any kind of fairnes= s from the OS
=A0 =A0 =A0> scheduler, esp. Linux's, which gladly jettisons any pre= tense of
=A0 =A0 =A0> fairness in the hope of getting better throughput.
=A0 =A0 Usualy, the scheduler is fair when you force all threads to run on = the
=A0 =A0 same processor.
=A0 =A0 But I would still prefer the LWT way for doing message passing.
=A0 =A0 --
=A0 =A0 Pierre

=A0 =A0 --
=A0 =A0 Caml-list mailing list. =A0Subscription management and archives:
=A0 =A0 https://sympa.inria.fr/sympa/arc/caml-list
=A0 =A0 Beginner's list: http://groups.yahoo.com/group/ocaml_be= ginners
=A0 =A0 Bug reports: http://caml.inria.fr/bin/caml-bugs



--047d7bb03e78f847dc04e7c0caba--