Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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:
http://www.annexia.org/freeware/pthrlib

Rich.

-- 
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com