Stas Bekman <[EMAIL PROTECTED]> writes: > Joe Schaefer wrote:
[...] > > Obviously I don't see why that is so. In fact, I see that it is > > already implemented in parts of mod_perl, for instance when > > registering a pool-cleanup callback: > > $sp->cleanup_register(sub { print @{ $_[0] || [] } }, [1..3]); > > Here the currently active interpreter has its refcount incremented > > by mpxs_apr_pool_cleanup_register(). AFAICT the interpreter is not > > allowed to reenter the thread pool until this cleanup has run. I > > don't see how PerlInterpScope influences this behavior at all. > > I still believe that this is the right approach, and again I wonder > > why this cannot also be used in the situations you cited earlier in > > this thread. > > Anti-Example 1: parent interpreter compiles the anon-sub, which > interpreter are you going to stick to that anon-sub? A: As I stated, I expect the intepreter which invokes cleanup_register() to also be the one which executes the anonymous sub during $sp's pool cleanup. Are you saying that doesn't work if the interpreter is actually a clone, and not the parent? Bear in mind I'm learning about threads|ithreads as I go here, so please don't intrepret my inquisitiveness as anything other than naivete. I'm just trying to sort all this out so I can write a few useful patches. As I slowly digest the rest of your post, it looks like I'll derive the most benefit from it by writing a few tests first. :-) -- Joe Schaefer --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]