home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / modula3 / 1041 < prev    next >
Encoding:
Text File  |  1992-11-22  |  1.6 KB  |  40 lines

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