Hello,

The iThread module now works in creating and joining in threads, however the
interesting issue is sharing variables between interpreters (otherwise we
just have fork...);

does :shared work in bleadperl? attrs.pm doesn't seem to have a clue about
it? There are two issues here as I see it.

The first passing a SV between two threads, if the thread that allocated the
SV destructs it will free the arena that the SV used, (assuming
perl_destruct_level > 0). I solved this temporarily by creating an empy
PerlInterpreter for keeping shared variables in.

The second problem is that perl_clone will clone all SVs it can find when
cloning. (No big surprise). Which means sharing has to implmeneted by either
magic or tie, both have performance problems.

I assume that :shared would have to set a flag on a SV so it is created
somewhere off the arena (?) and perl_clone will have to ignore cloning that
SV (?). Is this something that could go into 5.8? If so I can attempt a
patch but I am not sure I have the knowledge needed to make those parts
work.

Regards Artur



Reply via email to