[plt-scheme] (Delimited) continuations versus threads

From: Jakub Piotr Cłapa (jpc-ml at zenburn.net)
Date: Wed Oct 1 08:40:11 EDT 2008

1. If I understand correctly the shift/reset operator could be 
implemented using threads. (reset starts a child thread and waits for a 
reply sent by shift; shift sends the reply and binds k to a procedure 
waiting for further replies). The only difference I can think of is when 
you try to use the function created by shift multiple times (it will not 
work with threads). Is it the only difference?

2. What is the best way to write a nonblocking parser receiving data 
from a subprocess. Using continuations and feeding new data received on 
a port or spawning a new thread and using blocking requests?

I think that a simple thread would be better. Are continuations only 
useful when we want to serialize them to disk or restart the computation 
many times from the same break (as in HTTP)? And what if we had 
serializable threads?

-- 
regards,
Jakub Piotr Cłapa


Posted on the users mailing list.