From: Christophe Raffalli <Christophe.Raffalli@univ-savoie.fr>
Cc: caml-list@inria.fr
Subject: GC + thread
Date: Tue, 29 Feb 2000 16:49:14 +0100 [thread overview]
Message-ID: <38BBEA7A.BCC0B1E4@univ-savoie.fr> (raw)
In-Reply-To: <ya3em9x351s.fsf@serveur3-1.labri.u-bordeaux.fr>
The following extension for Ocaml GC seems to me simple and necessary (I
really do need it):
It considers only channels dans thread and I will describe it for a mark
and swip GC.
rule 1: a channel can be marked by the GC in two ways: read or write.
rule 2: a channel that is accssible by the GC in the usual way is both
marked read and write
(usual means in a way no covered by rule 3).
rule 3: if a closure if blocked while trying to read from channel R_1,
..., R_n
or to write from channel W_1,
..., W_n
- the channels R_1,..,R_n are marked as read
- the channels W_1,..,W_n are marked as write
- the closure will be examined by the GC if and only if
one the channel R_i is marked write or one the channel W_i is
marked read
if the condition is not immidiately true, the examination of
the closure is
postponed.
- if no channel R_i are marked write and no channel W_i are
marked
read at the end of the mark pass, the closure and the
corresponding thread
can be safely destroyed (the thread will never wake up).\x13
So clearly this require only a modification of the GC of blocked thread
and needs to keep to extra bits for channels (this is not a big cost).
I would be good to also introduce mono-directional channel (the function
create return a pair with an in_channel and an out_channel). In this
case the GC ca be optimized to collect more threads in a trivial way
(when the GC reaches the in part of a channel it is only marked read and
if the GC reaches the out part of a channel it is only marked write).
This extension is also necessary (it is easy to have realistic examples
where the GC would collect much more thread with this extension).
What do you think of that ?
--
Christophe Raffalli
Université de Savoie
Batiment Le Chablais, bureau 21
73376 Le Bourget-du-Lac Cedex
tél: (33) 4 79 75 81 03
fax: (33) 4 79 75 87 42
mail: Christophe.Raffalli@univ-savoie.fr
www: http://www.lama.univ-savoie.fr/~RAFFALLI
next prev parent reply other threads:[~2000-03-01 17:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-02-28 12:06 OCamlMakefile Remi VANICAT
2000-02-28 23:15 ` OCamlMakefile Pierre Weis
2000-02-29 15:49 ` Christophe Raffalli [this message]
2000-03-02 2:24 ` GC + thread Max Skaller
2000-03-02 9:31 ` Christophe Raffalli
[not found] ` <38BFEBFB.50487A27@maxtal.com.au>
2000-03-03 18:16 ` Christophe Raffalli
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=38BBEA7A.BCC0B1E4@univ-savoie.fr \
--to=christophe.raffalli@univ-savoie.fr \
--cc=caml-list@inria.fr \
/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