From: Xavier Leroy <xavier.leroy@inria.fr>
To: Dmitry Bely <dbely@mail.ru>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Inter-thread exceptions
Date: Mon, 9 Sep 2002 16:15:27 +0200 [thread overview]
Message-ID: <20020909161527.C1781@pauillac.inria.fr> (raw)
In-Reply-To: <vg5jnfl6.fsf@mail.ru>; from dbely@mail.ru on Fri, Sep 06, 2002 at 10:22:13PM +0400
> Nethertheless I think it's possible for network I/O, and even portable
> enough (should work under pthreads/windows threads). Roughly the idea is
> following:
>
> 0. Create a global "interrupt" socket.
> 1. Perform select() before each blocking syscall, waiting for readability
> of "interrupt" socket or the necessary state of "main" socket.
> 3. If "main" socket was in the necessary state, do the syscall.
> 4. If "interrupt" socket is readable, determine interrupt to which thread
> is requested. If it's other thread, call sched_yield() for pthreads
> (nothing under Windows) and return to (1)
For one thing, not all blocking syscalls can be made non-blocking
using select(). (Think opening a FIFO, for instance.) Moreover, not
all blocking syscalls are in C code that we control. (Think
gethostbyname(): it will do network I/O to query the DNS, but in a way
that we don't control.)
- Xavier Leroy
-------------------
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
next prev parent reply other threads:[~2002-09-09 14:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-03 13:48 Lauri Alanko
2002-09-04 14:43 ` Sven LUTHER
2002-09-04 15:30 ` Florian Douetteau
2002-09-05 11:30 ` Xavier Leroy
2002-09-06 18:22 ` Dmitry Bely
2002-09-09 14:15 ` Xavier Leroy [this message]
2002-09-11 20:41 ` Dmitry Bely
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=20020909161527.C1781@pauillac.inria.fr \
--to=xavier.leroy@inria.fr \
--cc=caml-list@inria.fr \
--cc=dbely@mail.ru \
/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