readv/writev

Robert Collins rbcollins@cygwin.com
Thu Aug 22 16:48:00 GMT 2002


On Fri, 2002-08-23 at 04:52, Conrad Scott wrote:
> There's no comparison possible right now since the existing code
...

K.
 
> I've looked at putting in readv/writev directly for disk files
> etc. (pipes and raw devices would benefit as well) but a general
> solution doesn't fit very well w/ the current structure of the
> fhandler classes: for example, the text-mode vs binary-mode code
> and something else I can't quite remember just now :-)

Yah. One thing I've been pondering for a while - strip out all the
text/binary translation for non FILE calls. I have done *any* research
to see if there are text-dependent apps using fd based IO, but there
probably are :p.

> I'd have thought that overlapped was the reverse of the Posix
> select/poll model.  That is, in NT you issue your IO operation and
> got told when it has completed, which allows for zero-copy IO and
> for queues of operations (shades of VMS indeed); 

Overlapped refers to capability for Win32 to have 'overlapping' IO's
outstanding, not to a specific notification mechanism. The
ReadFile/WSARecv interfaces support 3 interfaces I'm aware of:
un-notified (select)
notified via an event object (poll)
notified via a completion port.

> while the
> select/poll model is the opposite: you get told when a read/write
> would succeed if you were to do it.  You can't, w/ select/poll,
> issue a nonblocking IO operation and be told when it has completed
> (except for the strange cases of accept and connect).  And it's
> not clear to me how to bridge that gap.

USe WSAAsyncSelect and register for FD_WRITE and FD_READ. These get sent
when a socket is ready for writing/reading. We then keep a table of the
sockets we own, and update their state when we recieve the messages.

Select and poll then become trivial querys into our state table.

(If I misunderstood, and you wanted to emulate overlapped with
select/poll - sorry :]).

Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20020822/8368cb05/attachment.sig>


More information about the Cygwin-developers mailing list