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