readline() blocks after select() says there's data??

Michael Robin me at mikerobin.com
Wed Apr 3 12:34:55 EST 2002


"Kragen Sitaker" <kragen at pobox.com> wrote in message
news:83elihknoz.fsf at panacea.canonical.org...
> But all of those approaches are really ways to try to work around the
> fact that WaitForMultipleObjects (sp?) only works on signaling of
> event objects...

Not sure if I'm reading you right, but (Msg)WaitForMultipleObjects() will
work on a plethora of
system objects.
>From the docs at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/syn
chro_5gqb.asp and elsewhere:
------------------------------------
The MsgWaitForMultipleObjects function can specify handles of any of the
following object types in the pHandles array:
  a.. Change notification
  b.. Console input
  c.. Event
  d.. Job
  e.. Mutex
  f.. Process
  g.. Semaphore
  h.. Thread
  i.. Waitable timer
  j.. [mike: (1) sockets and (2) files, named pipes, serial comms - see
below]
(1) ...the native Windows function, WaitForMultipleObjects can also be used
for this purpose. This is especially useful if the thread needs to wait on
both socket and nonsocket events.
...A socket handle can optionally be a file handle in Windows Sockets 2. It
is possible to use socket handles with ReadFile, WriteFile, ReadFileEx,
WriteFileEx, DuplicateHandle...

(2) ...you can also use a file, named pipe, or communications device as a
synchronization object;
[...it is safer to use the event object because of the confusion that can
occur when multiple simultaneous overlapped operations are performed on the
same file, named pipe, or communications device. In this situation, there is
no way to know which operation caused the object's state to be signaled...]
------------

mike








More information about the Python-list mailing list