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

Has anyone tried Config{usethreads} on activestate's 5.8.0 on win2k? I am trying to find if the interpreter supports threads. This interpreter seems to support threads (I tried a couple of thread programs), but fails with the above check. Any clues?!! thanks, -sureshr
  • Comment on Does Config{usethreads} work on activestate's 5.8.0 on win2k?

Replies are listed 'Best First'.
Re: Does Config{usethreads} work on activestate's 5.8.0 on win2k?
by castaway (Parson) on Mar 13, 2003 at 07:45 UTC
    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.

      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
Re: Does Config{usethreads} work on activestate's 5.8.0 on win2k?
by jand (Friar) on Mar 13, 2003 at 00:01 UTC
    You probably want to check for $Config{useithreads} instead.
Re: Does Config{usethreads} work on activestate's 5.8.0 on win2k?
by pg (Canon) on Mar 13, 2003 at 05:36 UTC
    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};