monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Help: select() like functionality on pipes on Win32


From: Nathaniel Smith
Subject: Re: [Monotone-devel] Help: select() like functionality on pipes on Win32 - how?
Date: Mon, 18 Jul 2005 02:36:56 -0700
User-agent: Mutt/1.5.9i

On Mon, Jul 18, 2005 at 09:26:21AM +0200, Christof Petig wrote:
> ==> How can I wait for data to get available on a pipe on Win32? <==
> 
> I know about SetCommTimeout() (to implement non blocking IO) and
> ReadFileEx() (so called overlapping IO) but both methods need an actual
> read. There seems to be no way to implement a select like function (on a
> single pipe!) on windows.
> 
> My current (desperate) plan is to use ReadFileEx to implement
> overlapping IO and store the data in the Netxx::Stream for later reading
> but if anybody knows an easier way please tell me

"You're doomed".

The best solution is either: ReadFileEx, like you say (though I guess
that may not work so well with the various recent work to choke
netsync reads when the buffer of unprocessed work is getting too
large?  though this work is purely for performance, not correctness,
and dunno if it's going to work right anyway).  Or else,
WaitForMultipleObjects; but this is annoying it its own ways (mainly,
you can wait for only IIRC 64 objects at once.  I guess our netsync
server is probably going to die somehow before it manages to handle 64
simultaneous clients, since no-one has actually tried this, but...).

This sort of insanity is why I've been playing around with Chryn...
Chryn may be the large overkill solution for what you want, though.

-- Nathaniel

-- 
"But in Middle-earth, the distinct accusative case disappeared from
the speech of the Noldor (such things happen when you are busy
fighting Orcs, Balrogs, and Dragons)."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]