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

Re: [plt-scheme] Call/cc problem

In MzScheme, continuations may only be invoked by the same thread that
created them.  That's probably why you received the error message
  "continuation application: attempted to  cross a continuation boundary".
There are a few other places that set continuation boundaries, too, though.

Why can't A block on a semaphore until it receives an response from B?


At Wed, 12 Jun 2002 21:11:00 +0200, Erich Rast wrote:
> Sorry for asking such a general question on this list...I have 
> troubles with my ISP sending to comp.lang.scheme, so I hope perhaps 
> here someone can help me:
> My MzScheme application A communicates with the front-end B (written in
> another language) by exchanging commands. In order to do that, B can
> call a top-level receiver function of A in a modified
> read-eval-print-loop, while A has a function (send-command cmd) for
> sending something to B.
> The problem: Both A and B are non-blocking, independent operating system
> processes, but I 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.
> 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.
> I've taken a look at  Ferguson/Deugo: "Call with Current Continuation 
> Patterns", 2001, but  unfortunately, the paper is already a little 
> above my head. Could anyone outline me how to tackle this problem?
> Regards,
> Erich