home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / lisp / 2411 < prev    next >
Encoding:
Text File  |  1992-09-11  |  1.8 KB  |  53 lines

  1. Newsgroups: comp.lang.lisp
  2. Path: sparky!uunet!mcsun!sunic!aun.uninett.no!nuug!dhhalden.no!fenris.dhhalden.no!eskilb
  3. From: eskilb@dhhalden.no (Eskil Brun)
  4. Subject: Re: Sun Common Lisp & Foreign functions
  5. Message-ID: <eskilb.716241360@fenris.dhhalden.no>
  6. Keywords: foreign functions
  7. Organization: Ostfold College
  8. References: <1992Sep10.122629.8200@cs.joensuu.fi>
  9. Date: Fri, 11 Sep 1992 19:56:00 GMT
  10. Lines: 41
  11.  
  12. Hi,
  13.  
  14. like barmar explains, this has to do with the Lucid scheduler.
  15. it probably uses alarm(2) to generate SIGALRMs every *scheduling-quantum*.
  16.  
  17. i've been struggling with this myself for a while until i discovered
  18. the wizard-function (undocumented and unsupported) SYS::WITH-SIGNAL-MASK.
  19.  
  20. e.g.:
  21.  
  22. (defparameter SIGALRM 14)
  23. ;;; doffen(bash)$ man 5 signal
  24. ;;; SIGALRM       14     A         alarm clock; see alarm(2)
  25.  
  26. (defparameter SIGALRM-MASK (expt 2 (1- SIGALRM)))
  27.  
  28. ...
  29.    ;; Mask away Lisp scheduler interrupts while executing the body of
  30.    ;; this code. It is a kind of Lispm WITHOUT-INTERRUPTS, but bypasses
  31.    ;; the scheduler logics altogether.
  32.    (sys::with-signal-mask (logior SIGALRM-MASK (sys::get-signal-mask))
  33.  ;;; Note that this doesn't work:
  34.  ;;; > (sys::with-interrupts-deferred
  35.  ;;;     (list (setq acceptsock
  36.  ;;;       (std-c-library::accept sock acceptsockaddr sixteen))
  37.  ;;;       (enlib:sys-errlist)))
  38.  ;;; (-1 "Interrupted system call")
  39.      (let* ((send-chunk-len 512)
  40.             (str-len (length str))
  41. ...
  42.  
  43. Cheers,
  44. Eyvind. (Not Eskil ;-)
  45.  
  46. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
  47.  Eyvind Ness                    Internet Email: Eyvind.Ness@HRP.No
  48.  Research Scientist             Phone: +47 9 183100
  49.  Control Room Systems Division  Fax: +47 9 187109
  50.  OECD Halden Reactor Project    Snail Mail: P.O. Box 173, N-1751 Halden
  51.  Norway
  52. +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
  53.