delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/05/18/17:15:25

From: newsham AT lava DOT net (Tim Newsham)
Subject: comments
18 May 1998 17:15:25 -0700 :
Message-ID: <m0ybZtV-00113YC.cygnus.cygwin32.developers@malasada.lava.net>
Mime-Version: 1.0
To: cygwin32-developers AT cygnus DOT com

Some notes about comments in select.cc in the latest snapshot:

   /* FIXME: Why is except handled in a different fashion??? */
   /* And why is sock a global instead of a local variable?  It
      looks like all the main cygwin32_select code does is close it. */

the answer is that "sock" is used as a way to shut down the socket select
thread.  The select thread waits on exceptions on the global sock
descriptor.  When the sock is closed by the main thread, the handle
is selected for exceptions in the socket thread, and the select is
broken.  Otherwise the main thread would have no way to break the
select thread's blocking select() call.

There is also a
   /* FIXME: Add explanation for the +1 fix that Tim Newsham added */
but this comment is above a different, unrelated "+1" in the code.
In this case the "+ 1" is the extra handled used to wait for signal
arrival.  The "+ 1" from my fix is at:

    except_sock_map = new fd_socket_map (total_except_number + 1);

                                        Tim N.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019