home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.modula3
- Path: sparky!uunet!haven.umd.edu!decuac!pa.dec.com!src.dec.com!frode@toaster.SFSU.EDU
- From: frode@toaster.SFSU.EDU (Frode Odegard)
- Subject: Failing system calls and threads
- In-Reply-To: John Haxby's message of Fri, 20 Nov 1992 12:07:34 GMT <1992Nov20.120734.23671@rdg.dec.com>
- To: jch@rdg.dec.com
- Message-ID: <9211220534.AA01666@toaster.SFSU.EDU>
- Cc: m3
- Date: Sat, 21 Nov 92 21:34:42 PST
- Lines: 28
-
-
- John Haxby <jch@rdg.dec.com> writes about the errno problem.
-
- This is indeed a known problem. The solution you suggest is something
- we tried for a UNIX Modula-2 library we put out last year - it seems
- to work. The library has a "layer" with Modula-2 definition modules
- for system calls, where the wrapper scheme you mention is used. The
- global 'errno' is fetched and returned as a function result. In the
- upper layer, threads can safely make system calls without worrying
- about errno.
-
- To my knowledge, Sun has a rather more exotic solution to the problem,
- which I believe involves some compiler/linker enhancements (?). A few
- "standard" C libraries are stateful and utilize global variables -
- they ordinarily are not reentrant. So somehow I think they manage to
- store local copies of those global variables in a portion of the
- thread's workspace.
-
- It does make a lot of sense to implement system calls the way you
- suggest, since Modula-3 has exceptions. What are SRC's plans here, I
- wonder.
-
- - Frode
-
- --------------------------------------------------------------------
- Odegard Labs, Inc., 100 Bush St., Suite 2101, San Francisco,
- CA 94104-3909, USA; +1-415-434-4242, +1-415-434-4243(fax),
- frode@odegard.com(internet)
-