home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / programm / 3380 < prev    next >
Encoding:
Internet Message Format  |  1992-12-31  |  1.5 KB

  1. Xref: sparky comp.programming:3380 comp.unix.programmer:5805
  2. Path: sparky!uunet!spool.mu.edu!uwm.edu!csd4.csd.uwm.edu!markh
  3. From: markh@csd4.csd.uwm.edu (Mark)
  4. Newsgroups: comp.programming,comp.unix.programmer
  5. Subject: Re: Network Chat Messaging Algorithm
  6. Followup-To: comp.unix.programmer
  7. Date: 31 Dec 1992 19:08:17 GMT
  8. Organization: Computing Services Division, University of Wisconsin - Milwaukee
  9. Lines: 19
  10. Message-ID: <1hvgf1INNkb1@uwm.edu>
  11. References: <1h8752INNn3i@darkstar.UCSC.EDU> <1h9k9hINN670@uwm.edu> <1992Dec31.023104.13944@netcom.com>
  12. NNTP-Posting-Host: 129.89.7.4
  13.  
  14. markh@csd4.csd.uwm.edu (Mark) writes:
  15. >Net lag is not causing those problems, select() is.  Always check for blocking
  16. >even if set in non-blocking mode, because select() sometimes blocks regardless.
  17. >Or, better, don't use select().  Use fork().
  18.  
  19. In article <1992Dec31.023104.13944@netcom.com> pdh@netcom.com (Phil Howard ) writes:
  20. >Of course select() blocks.  It's supposed to if none of the fd's have anything
  21. >and the time is non-zero.
  22.  
  23. You misunderstood.  My fault.  I meant to say: always check for blocking by
  24. setting all devices to non-blocking mode, because select() sometimes indicates
  25. devices ready for I/O that are still in a blocking state, regardless of
  26. whether you set them for non-blocking or not.
  27.  
  28. All devices have to be set for non-blocking mode even if you use select(), and
  29. you have to check for EWOULDBLOCK on the device select()'ed on each I/O access.
  30.  
  31. It's a moot point.  The problem referred to in the original article has already
  32. been demonstrably proven to be solved with fork().
  33.