From: newsham AT lava DOT net (Tim Newsham) Subject: comments 18 May 1998 17:15:25 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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.