[gambit-list] Thread undocumented features...

David St-Hilaire sthilaid at iro.umontreal.ca
Tue Sep 1 13:58:17 EDT 2009

Hi all!

I address this message to Marc, but I thought it might interest others so I
cc'ed it to the gambit list ;).

What is the difference between the undocumented thread-interrupt! and
thread-suspend! functions? Is it possible to retrieve an interrupted thread's

Basically I want to know if its possible to do something like:

(let ((t (make-thread
          (lambda () (let loop ((i 0)) (write 'o_O) (loop (+ i 1)))))))
  (thread-start! t)
  (thread-sleep! 0.5)
  (thread-interrupt!/suspend! t)
  (let ((k (get-the-continuation t)))
    (continuation-graft k (lambda (r) i))))

I don't know if this pseudo code is clear enough to illustrate my needs? I'd
like to stop another thread and use continuation-graft to execute some code on
it's stack.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20090901/5f0f1235/attachment.sig>

More information about the Gambit-list mailing list