At 10:31 AM -0400 4/12/05, Stas Bekman wrote:
so before this thread dies (and it must not!) here are the suggestions so far:

1) add a positive voice class method: SHOULD_CLONE (or whatever wording) and do cloning unless SHOULD_CLONE exists and returns false:

  + intuitive for the end users
  - since by default perl does cloning, when not having SHOULD_CLONE
    defined it'll still clone it's a bit confusing in the
    implementation logic.

2) add a negative voice class method: CLONE_ME_NOT (or whatever wording)
and do cloning unless CLONE_ME_NOT exists and returns true:

 + makes the perl-core implementation logic better
 - might be confusing for users (as they will have to deal with
   the reversed logic)

3) disable cloning of objects by default and only enable if one the (1) or (2) is in force (and CLONE doesn't exist)

  + automatically makes CPAN perl-thread-safe
  - may break some modules which were relying on the default cloning

4) simply check whether the sub CLONE (we have it already in the API) exists (bypassing inheritance, so a child will have to define CLONE to be CLONE-able) and if not do not clone.

 + automatically makes CPAN perl-thread-safe
 + requires no new API
 - may break some modules which were relying on the default cloning
  (but that could be easily fixed by just adding an empty sub CLONE {}
   in the affected CPAN modules)

I'd be in favor of a solution which can be made available to users immediately, i.e. not in 5.10. mod_perl 2 will be released any moment now and because of this issue users of threaded Apache may be unable to use it.

I would go for 4, with a CPAN module a la Thread::Bless that would mimic this behaviour on Perls < 5.10.



Liz

Reply via email to