On Fri, 18 May 2001 16:01:42 +0200, Artur Bergman wrote:
>I have understood that the current ithread implmentation is unsafe because
>of the regex engine. The only notes I could find on this is ActiveStates
>release notes on the pseudo forking.

Please grep the p5p archives.  There is a lot of previous traffic on this.

>My very limited understand of the issue is that the regex engine changes the
>op tree for certain cases and ithread depends on it to be immutable.

Yes, perl_clone() does.  Independent interpreters aren't affected.

>Is this fixable? How can it be fixed, must the regex engine be partly
>rewritten not to recompile the optree? Can we create a copy of the optree
>for a given regex and let it modify it?

IMO, the cleanest way is to keep all the mutable state of a regex is
in a pad entry.  This will cure not only thread-related problems, but
bugs that show up in recursion, such as the ones described here:

  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1998-11/msg00648.html
  http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-01/msg01405.html

>I have very little understand of how the optree, opcodes and the regex
>engine works. How come that the regex engine changes the optree but not eval
>""; ?

eval"" doesn't change any existing optree.  It simply creates a new one.


Sarathy
[EMAIL PROTECTED]

Reply via email to