home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / modula3 / 1045 < prev    next >
Encoding:
Internet Message Format  |  1992-11-23  |  973 b 

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!uwm.edu!biosci!parc!mdixon
  2. From: mdixon@parc.xerox.com (Mike Dixon)
  3. Newsgroups: comp.lang.modula3
  4. Subject: Re: Failing system calls and threads
  5. Message-ID: <mdixon.722292900@thelonius>
  6. Date: 20 Nov 92 20:55:00 GMT
  7. References: <1992Nov20.120734.23671@rdg.dec.com>
  8. Sender: news@parc.xerox.com
  9. Organization: Xerox PARC
  10. Lines: 14
  11.  
  12. actually, this turns out to be a non-problem; if you look in Thread.m3
  13. you'll discover that it maintains a separate value of errno for each
  14. thread, and swaps it in and out of the global variable on each thread
  15. switch.  thus errno is essentially a thread-local variable, and you
  16. can go ahead and use code like
  17.  
  18.         if (write (fd, buf, sz) < 0)
  19.                 if (errno == EINTR)
  20.                         /* try again */
  21.                 else
  22.                         perror ("write")
  23.  
  24. without fear of interference from other threads.
  25.                                              .mike.
  26.