caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Markus Mottl <markus@oefai.at>
To: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Native threads under Debian 3.0r0
Date: Wed, 4 Sep 2002 15:01:51 +0200	[thread overview]
Message-ID: <20020904130151.GB1375@kiefer.ai.univie.ac.at> (raw)
In-Reply-To: <20020904191523M.garrigue@kurims.kyoto-u.ac.jp>

On Wed, 04 Sep 2002, Jacques Garrigue wrote:
> In bytecode "something_to_do" is used, and checked pretty often:
> at every function call and every loop iteration.

Ok.

> However, this would mean too much overhead for native code, so switching
> is only checked when the GC is called.

Actually, calling the GC manually does not make any difference. The only
thing that helps is calling "Thread.yield" in the infinite loop.

> To make it work even on slowly allocating programs, the young generation
> is declared "full" every once in a while, but there must still be some
> allocation for it to happen.

I see. So if the GC doesn't really have to do any work, it will also
not switch threads even when called manually.

> So the answer is: a native code thread should be allocating some data,
> otherwise it cannot be interrupted. The problem does not exist for
> bytecode.

The main consideration is obviously native code performance. OTOH, some
people might want to guarantee that their threads never get stuck. I
don't know what solution would be useful for them. Maybe some runtime
or command-line switch that trades efficiency against such scheduling
problems.

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  parent reply	other threads:[~2002-09-04 13:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-03 23:03 Berke Durak
2002-09-04  9:44 ` Markus Mottl
2002-09-04 10:15   ` Jacques Garrigue
2002-09-04 10:39     ` Olivier Andrieu
2002-09-04 13:01     ` Markus Mottl [this message]
2002-09-04 15:14       ` Berke Durak
2002-09-04 23:38         ` Jacques Garrigue
2002-09-04 14:38 ` Sven LUTHER
2002-09-05  9:17   ` Stefano Zacchiroli
2002-09-05 10:42     ` Sven LUTHER
2002-09-05 11:37       ` Stefano Zacchiroli

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=20020904130151.GB1375@kiefer.ai.univie.ac.at \
    --to=markus@oefai.at \
    --cc=caml-list@inria.fr \
    --cc=garrigue@kurims.kyoto-u.ac.jp \
    /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).