ad 1: I don't know what that is. Can you explain?luowy wrote:Josef,
1, shared stack coroutine is more valuable than independent stack one;
2,sperate scheduler from coroutine is needed,
Q: where the trap handle code for coroutine? what happen when coroutine traped?
ad 2: Coroutines by definition don't need a scheduler but are scheduled explicitly by calling Transfer.
Depending on the application, something like a scheduler, i.e. a component that handles the transfer of control
among a set of coroutines by applying specific rules and conventions, can be added.
Since this is likely to be application specific, it is not included in the base module.
I would expect such things directly included with an application or, if there is a potential for reuse by others,
in a CPC package.
The trap handling code for coroutines is in Kernel. It is almost the same code as for the main stack.
When a coroutine traps, a trap viewer is opened that shows the stack of the coroutine.
Then control is transferred to main. If there is a follow-up trap in main, then a second trap window is opened
that shows the main stack.
- Josef