Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ah, the eternal problem of asynch unwind!

  (without-interrupts 
    (acquire-resource)
    (unwind-protect
        (with-local-interrupts
          (do-jobs-might-block-or-whatever))
      (release-resource)))
... and to cancel:

  (interrupt-thread thread (lambda () (abort-thread)))
I think what is really needed is just exception (unwind cleanup) mechanism and a cheap way to mask interrupts. Signal deferral mechanism does exactly that -- so that with(out)-interrupts just simply set a variable and don't need to go through syscall.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: