home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / hp / 9222 < prev    next >
Encoding:
Internet Message Format  |  1992-08-12  |  1.7 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!jvnc.net!netnews.upenn.edu!saul.cis.upenn.edu
  2. From: freeman@saul.cis.upenn.edu (Jon Freeman)
  3. Newsgroups: comp.sys.hp
  4. Subject: read() not blocking on empty stdin in 8.07
  5. Message-ID: <86042@netnews.upenn.edu>
  6. Date: 13 Aug 92 00:37:42 GMT
  7. Sender: news@netnews.upenn.edu
  8. Organization: University of Pennsylvania
  9. Lines: 25
  10. Nntp-Posting-Host: saul.cis.upenn.edu
  11.  
  12. One of our large programs (written in APL) starts up another process
  13. (written in C) and opens up a pipe through which the two programs
  14. communicate; the APL process sends the desired operation + arguments
  15. and the C process sends back the result.  (We do this because most C
  16. programs are faster than their APL counterparts, of course).  The C
  17. processes communicate using a set of interface routines which the APL
  18. vendor provides, and we have the source code to those routines.  They
  19. work on all of our other platforms, but...
  20.  
  21. The C process spends most of its time waiting for input from the APL
  22. process, naturally.  It calls read() on stdin, which should block if
  23. there's nothing in the pipe.  Instead of blocking, however, read()
  24. *sometimes* returns immediately with a value of 0.  The man page for
  25. read() says that this is correct behavior when certain flags are set
  26. for the file descriptor in question, but I don't know if those flags
  27. are set for stdin.  Is HP-UX's read() supposed to block on stdin if
  28. it's empty?  If so, has anyone else experienced this problem?
  29.  
  30.             Thanks in advance,
  31.                  Jon
  32.  
  33. -------------------------------------------------------------------------------
  34. All life is suffering.               |     Jon Freeman
  35. The cause of suffering is desire.    |     freeman@gradient.cis.upenn.edu
  36. I want my MTV.                       |     Office: (215) 898-4612
  37.