Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
select (or polling) on in_channel?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-04-05 (14:30)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] select (or polling) on in_channel?
On Tue, Apr 05, 2005 at 09:34:39AM -0400, Eijiro Sumii wrote:
> I rather want to avoid multi-threading if select could be easy enough,
> because the former is often too tricky due to the possibility of
> deadlocks and races.

You can implement threads on top of select / poll semantics.  You also
need to have a stack switching operation (such as makecontext /
swapcontext, setjmp / longjmp, or a bit of asm).  Proof by example:


Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology -
Team Notepad - intranets and extranets for business -