You can also use 'perl -V' to find out if threads are built in..
My 5.6.1 on Linux says:
usethreads=define use5005threads=define useithreads=undef usemultiplicity=undef
Which means its got 5005 threads built in.
And 5.8.0 with ithreads:
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
C. | [reply] |
Output from Perl 5.8.0 -V is
Summary of my perl5 (revision 5 version 8 subversion 0) configuration:
Platform:
osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
usethreads=undef use5005threads=undef useithreads=define usemultiplicity=define
which basically says that useithreads is defined. But I also get for 5.6, the same
Summary of my perl5 (revision 5 version 6 subversion 0) configuration:
Platform:
osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
usethreads=undef use5005threads=undef useithreads=define usemultiplicity=define
And my perl test program does not work with 5.6 as I dont have the thread module.
Another question is does use Thread and use threads same? What is the difference between them?
thanks,
-sureshr
| [reply] |
You probably want to check for $Config{useithreads} instead. | [reply] |
This piece of code has been tested on win2k:
use Config;
print "use 5005 threads\n" if $Config{use5005threads};
print "use ithreads\n" if $Config{useithreads};
| [reply] [d/l] |