I am starting to use mutithreading in an application that is unit tested with PerlUnit. The problem is that part of the application uses a module called KinoSearch, which is not thread safe. The following page:
http://perldoc.perl.org/threads.html#BUGS-AND-LIMITATIONS
says that you can get around the issue by loading the non-thread-safe module only at a time when you know that no new threads won't be spawned.
This is completely uinrealistic when you are running a bunch of unit tests with PerlUnit. I have several unit tests which create instances of various classes and exercise them in certain ways. Some of these classes will be spawning new threads, and some won't. PerlUnit gives me no control whatsoever on the order in which tests are being carried out. And even if it did, I have many different tests which spawn new threads, so it's pretty hard to determine a point where no new threads will be created.
How do people deal with this issue?
Thx
Alain Désilets