home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / arch / 11936 < prev    next >
Encoding:
Text File  |  1992-12-24  |  2.6 KB  |  58 lines

  1. Newsgroups: comp.arch
  2. Path: sparky!uunet!munnari.oz.au!spool.mu.edu!umn.edu!kksys.com!edgar!technix!bret
  3. From: bret@technix.mn.org (Bret Indrelee)
  4. Subject: AST on UNIX
  5. Message-ID: <1992Dec24.180908.6772@technix.mn.org>
  6. Summary: How can you do AST on UNIX?
  7. Organization: Private System - Saint Paul, MN
  8. References: <1992Dec23.050719.4047@ryn.mro4.dec.com> <id.CG2W.R8A@ferranti.com> <1992Dec23.212321.26522@ryn.mro4.dec.com>
  9. Date: Thu, 24 Dec 1992 18:09:08 GMT
  10. Lines: 46
  11.  
  12. In article <1992Dec23.212321.26522@ryn.mro4.dec.com> Peter.Mayne@cao.mts.dec.com writes:
  13. >
  14. >In article <id.CG2W.R8A@ferranti.com>, peter@ferranti.com (peter da silva) writes:
  15. >
  16. >>That's right. The UNIX programming model. The point is that the UNIX API is
  17. >>very high level, and can be modified to provide any capability I've ever
  18. >>heard of without breaking it. There is NO excuse for any new operating
  19. >>system after about 1984 or 85 to use anything lower level. It increases the
  20. >>cost of software design, increases the cost of education and training, and
  21. >>decreases the amount of commonly available high quality software.
  22. >
  23. >OK, try this. VMS has something called an AST (Asynchronous System Trap) which
  24. >is similar to a user-mode interrupt. This may occur at any time: for instance,
  25. >an asynchronous I/O can call an AST routine when the I/O completes. When the
  26. >AST routine completes, control returns to the code that was executing at the
  27. >time the AST occurred. (The analogy in NT is the APC, or Asynchronous
  28. >Procedure Call.)
  29. >
  30. >Now, much of the run-time stuff in UNIX is non-reentrant. In particular, the 
  31. >use of errno springs to mind. If the AST (or APC) was introduced into the
  32. >UNIX model, how can I use these non-reentrant routines safely in an AST
  33.  
  34. While you are at it, don't forget to include a separate 32-bit value
  35. passed to the AST.  The AST is fully queue'd, and if you send 32 ASTs
  36. before the application executes it's handler the application will still
  37. see ALL the ASTs with their separate 32-bit value.
  38.  
  39. If you can make this work, now port it to AIX, SunOS, Solaris, Ultrix,
  40. IRIX, and HP-UX.  Those are the only environments I currently would like
  41. it on, I'm sure there would be more within a few months.
  42.  
  43.  
  44. BTW, if you really want to emulate it then set the priority of the AST
  45. handler above the scheduler (after locking it in memory, of coarse) so
  46. that it can have high priority.
  47.  
  48. ---
  49.  
  50. In my environment, ASTs and ASYNC I/O are the two best features of VMS.
  51. Event flags come close, but not quite as valuable.
  52.  
  53. -Bret
  54. -- 
  55. ------------------------------------------------------------------------------
  56. Bret Indrelee               |         Nature Adores Chaos
  57. email: bret@technix.mn.org  |   
  58.