in reply to Re^2: Callstack manipulation?
in thread Callstack manipulation?
I'm sorry, I don't really know Coro all that well. Consulting the docs, it says that a coroutine consists of:
Everything else is shared. I don't see how you could get around having the first three items kept seperate. The fourth item is likely to be small compared to the others.
In terms of actually cloning the perl interpreter, a quick test (given bellow) shows that a new callchain is created rather than cloning the current one. So I guess I wouldn't describe the action as cloning
Some benchmarking would probably be worthwhile to determine how much Coro actually costs in terms of time and space required. From there you can determine whether or not Coro is practical or not for your problem.
use strict; use warnings; use Carp 'carp'; use Coro; $\ = $/; sub A { my $a = 1; async { print $a++; carp; cede; print $a++; } print $a++; carp; cede; print $a++; } A;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Callstack manipulation?
by LanX (Saint) on Nov 02, 2008 at 12:57 UTC | |
by LanX (Saint) on Nov 03, 2008 at 01:53 UTC |