in reply to Test::More and semaphore handles on Windows

Test::Builder keeps around information about each test executed to do its reporting at the end of the test file. This is effectively global data.

So that Test::Builder can work with tests that use thread (or tests for code that uses thread), it has to make sure that that global data is thread-safe, hence the use of sharing.

This is only an issue with ithreads, so it only affects Perls of 5.7.x and later.

  • Comment on Re: Test::More and semaphore handles on Windows

Replies are listed 'Best First'.
Re^2: Test::More and semaphore handles on Windows
by blm (Hermit) on Aug 25, 2004 at 05:27 UTC
    As I understand it, the problem related to Test::Builder will affect 5.8 and later because the current version of Test::Builder checks that perl version is greater then 5.008 before it enables this thread safety. From Test::Builder:
    BEGIN { use Config; if( $] >= 5.008 && $Config{useithreads} ) { require threads; require threads::shared; threads::shared->import; } else { *share = sub { 0 }; *lock = sub { 0 }; } }
    Is this correct?

      Yes, that's correct, because Perl 5.7.x switched to a different threading model.