timfar has asked for the wisdom of the Perl Monks concerning the following question:

Can someone please tell me if there's anything special I have to do in building a Perl extension if it's going to be called by a multi-threaded Perl script? Thanks!!

Replies are listed 'Best First'.
Re: Perl extension and Multiple Threads
by Zaxo (Archbishop) on Aug 17, 2004 at 00:48 UTC

    For a pure perl module, nothing. For XS code, you should build with the target threading perl. Not all modules have been updated to the current threading API, so you should check what you're building to see if it's thread safe. Look for the pTHX_ macro at the start of all the subroutine declarations.

    After Compline,
    Zaxo

Re: Perl extension and Multiple Threads
by PerlingTheUK (Hermit) on Aug 17, 2004 at 07:05 UTC
    I had some problems with file interlockings previously, so you might want to take care of that.
      Could you please elaborate?