[Xapian-discuss] Perl threads and Xapian - incompatibility?

Olly Betts olly at survex.com
Fri Oct 19 04:58:54 BST 2007


On Fri, Oct 19, 2007 at 05:54:07AM +0200, Ron Kass wrote:
> Perl after 5.8.7 has support for the |CLONE_SKIP| special subroutine. 
> Like |CLONE|, |CLONE_SKIP| is called once per package; however, it is 
> called just before cloning starts, and in the context of the parent 
> thread. If it returns a true value, then no objects of that class will 
> be cloned; or rather, they will be copied as unblessed, undef values. 
> This provides a simple mechanism for making a module threadsafe; just 
> add |sub CLONE_SKIP { 1 }| at the top of the class, and |DESTROY()| will 
> be now only be called once per object. Of course, if the child thread 
> needs to make use of the objects, then a more sophisticated approach is 
> needed.
> 
> Your thoughts?

Does doing as that suggests solve your problem?

Cheers,
    Olly



More information about the Xapian-discuss mailing list