I would like to know if there is interest in moving generators (and,
as a prerequisite, continuations) to the main image.
I'd be happy with them in kernel as long as this doesn't later lead to
sacrificing the performance of the engine in general to improve
performance of the (apparently stack-copying-on-resume) continuation
support.
Stack copying on resume is done simply with "thisContext deepCopy".
Actually, having them in the kernel does speed up the generator example
by 15%, but that's because I added a primitive equivalent to this code:
resume: returnValue nextContinuation: aContext
| continuation |
stack isNil ifTrue: [ ^self primitiveFailed ].
continuation := stack.
stack := aContext.
thisContext parentContext: continuation.
^returnValue!
... but which does not need to construct a real object for thisContext.
As I anticipated, stack-copying-on-resume is a matter of doing
continuation resume: value nextContinuation: stack deepCopy
while the more efficient version
continuation resume: value nextContinuation: nil
only allows a continuation to restart once.
Paolo
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk