Jens Rieks <[EMAIL PROTECTED]> wrote:

> here is a working version of my new Stream library.  I will add more
> documentation later this month, the examples should be enough to
> understand the usage.

I'm currently investigating a bunch of SIGSEGVs when tracing the examples.
They are all coming from Stream::Sub's usage of continuations:

,--[ Stream::Sub ]------------------------------------------------------
| This special "method" can call C<write>, which will internally create
| a Continuation to return to the current execution point when read is
| called the next time. The C<read> method creates a continuation before
| invoking the provided sub or the continuation captured by the write
| method. C<read>'s continuation is used to return the string parameter
| passed to C<write> as the return value of the read method.
`-----------------------------------------------------------------------

The problem seems to be context handling. When C<write> creates the
Continuation, it saves a different context as that one that is inplace
and will be restored, when the Continuation is invoked.

Further, in C<rawRead> P1 is stored away (and invoked later), which
isn't allowed.  But cloning it doesn't help because the continuation
context is still wrong.

I think to get that right we need some more support to copy contexts
around.

How exactly should these contexts look like for these two
continuations?

leo

Reply via email to