Dan Sugalski <[EMAIL PROTECTED]> wrote:At 6:46 PM +0200 7/20/04, Leopold Toetsch wrote:
I forgot that in my proposal. Subroutine PMCs need duplication for new threads.
That doesn't work for closures, which can be shared across threads in a pool.
We don't have shared closures. We don't have thread pools. Not in any thread papers here on the list.
This all came up with the big thread blowup at the beginning of the year.
http://www.nntp.perl.org/group/perl.perl6.internals/20181
amongst others.
"We dont't optimize for threads" - Dan.
Yeah, but neither do we design in a way that makes threading impossible or phenomenally difficult.
Can you please elaborate a bit more on that issue. And why these closures need to be shared.
Any closure, or any other anonymous sub can be stuck into a PMC. Since they can be shared that means they'll cross threads. I suppose you could defer cloning its info until it was actually shared.
Still, this scheme means as soon as you fire up a thread you have to go and clone off the interpreter information on all the named subroutines, which is a lot of work.
> ... Also, in the face of continuations the cache is usefulexactly *once*
No. The whole frame is the continuation. Its holding exactly the interpreter state at the time of calling into the sub. Including registers, which makes register preserving obsolete.
Which means that as soon as you use it the first time it becomes useless, since you can't know when it stops being used. That makes them one use--every time you enter the sub you need a new one, just as if you were calling in recursively.
It's just not going to fly, Leo. -- Dan
--------------------------------------it's like this------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk