caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Stephen Dolan <stephen.dolan@cl.cam.ac.uk>
To: Jiten Pathy <jpathy@fssrv.net>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Multicore runtime
Date: Mon, 8 Sep 2014 11:05:29 +0100	[thread overview]
Message-ID: <CA+mHimMNNOvBLnRvU-aiYe87j2KLzyxVc5OrGVvPEf1MDV9XAg@mail.gmail.com> (raw)
In-Reply-To: <CAL2Z3DCMB83vM-QhcqnPPrT2f0WJ_pBWvLZGk7e0YvfBn67h6g@mail.gmail.com>

On Sun, Sep 7, 2014 at 10:47 PM, Jiten Pathy <jpathy@fssrv.net> wrote:
> Hello,
> Nice work by stephen et al. on multicore runtime. Just had some questions:-
> 1. What's the mapping between os threads and domains?

One-to-one.

> 2. How does blocked fibers on a domain work? Does a blocked os thread
> running a fiber creates new os thread for that domain?

Fibers blocked on internal events (e.g. waiting for another fiber to
fill in an mvar) don't block anything - the system just runs some
other fiber. Fibers blocked on long-running / blocking C calls do
block the domain. If they do so for long enough, other fibers on the
domain will be moved to active domains.

Generally, we're going to try to avoid blocking C calls and instead
use select/poll/kqueue/epoll to handle blocking I/O. From the fiber's
point of view, this looks like normal blocking I/O, except if a system
call returns EWOULDBLOCK we'll switch to another fiber until the I/O
is ready.

> 3. Is there anyway for a fiber to relinquish a domain, for the ones
> that do loops for a significant period of time without blocking other
> fibers?

There's a yield function that can be called explicitly. Currently,
compute-bound fibers that don't yield do tie up a domain.

Stephen

  reply	other threads:[~2014-09-08 10:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-07 21:47 Jiten Pathy
2014-09-08 10:05 ` Stephen Dolan [this message]
2014-09-08 10:27   ` Peter Zotov
2014-09-08 10:45     ` Roberto Di Cosmo
2014-09-08 10:45   ` Leonardo Laguna Ruiz
2014-09-08 11:06     ` Adrien Nader
2014-09-08 14:49   ` Jesper Louis Andersen
2014-09-08 15:08     ` [Caml-list] format of .annot files Francois Berenger
2014-09-08 15:56     ` [Caml-list] Multicore runtime Anil Madhavapeddy
2014-09-08 17:32       ` Jesper Louis Andersen
2014-09-09  2:24         ` Yotam Barnoy
2014-09-09 15:06           ` Stephen Dolan
2014-09-09 15:26             ` Yotam Barnoy
2014-09-10 22:01               ` Stephen Dolan
2014-09-10 22:42                 ` Yotam Barnoy
2014-09-11  8:39                   ` Stephen Dolan
2014-09-11  8:53                     ` Malcolm Matalka
2014-09-11 13:42                       ` Yotam Barnoy
2014-09-12 10:42                       ` Stephen Dolan
  -- strict thread matches above, loose matches on Subject: below --
2014-05-29 23:04 Jiten Pathy
2014-06-05 17:01 ` Stephen Dolan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+mHimMNNOvBLnRvU-aiYe87j2KLzyxVc5OrGVvPEf1MDV9XAg@mail.gmail.com \
    --to=stephen.dolan@cl.cam.ac.uk \
    --cc=caml-list@inria.fr \
    --cc=jpathy@fssrv.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).