David Storrs wrote:
Well, at least that's a nice simple explanation.  Why couldn't anyone
have explained it to me that way before?  Unfortunately, it means that
continuations are a lot less useful than I thought they were.  :<

Actually, I think you're underestimating the little guys. After all, if they rolled back *all* of your changes, all they could do was repeatedly execute the same code!


How do continuations and threads interact?  When you take a cont, are
you taking it only within the current thread?  Or does it snapshot all
threads in the process?

Continuations are an operation on the call stack (although it's usually a call chain for continuations), so a continuation only operates on the current thread. I think.


(Incidentally, IIRC you can implement user-mode cooperative threading with continuations--yield() enqueues its return continuation and then dequeues and invokes another thread's continuation. But that's not what you're asking at all.)

--
Brent "Dax" Royal-Gordon <[EMAIL PROTECTED]>
Perl and Parrot hacker

Oceania has always been at war with Eastasia.

Reply via email to