[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [plt-scheme] Call/cc problem



[This was also posted at comp.lang.scheme]

Hobbyist wrote:

> I've tried to store continuations in an object and let
> them be called by the receiver function, but I get
> "continuation application: attempted to cross a
> continuation boundary" when using call/cc, and
> "continuation application: attempt to jump into an escape
> continuation" when using call/ec.

The PLT MzScheme: Language Manual says (in 6.3 Continuations)
this about call/cc:
    A continuation can only be invoked from the thread
    (see Chapter 7) in which it was captured.
Thus B can not use the continuation returned from A.

Since escape continuations only can be for escapes, you
can not call an escape continuations from another thread.

My feeling is that continuations are the wrong way to go.

> The problem: Both A and B are non-blocking, independent
> operating system processes, but need A to be able to send
> commands synchronously, ie. I need a function (send/sync-
> command cmd) that sends cmd to B, waits until B has
> replied with another command, returns the reply and then
> continues like if an ordinary function had been called.

Have you tried using some the thread synchronization mechanisms
in 7.2 or 7.3?

URL:http://download.plt-scheme.org/doc/200alpha19/html/mzscheme/mzscheme-Z-H
-7.html#%_chap_7

--
Jens Axel Søgaard