Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Code below the thread creation not getting executed in windows perl script

by ramlight (Friar)
on Jul 23, 2009 at 17:54 UTC ( [id://782737]=note: print w/replies, xml ) Need Help??


in reply to Code below the thread creation not getting executed in windows perl script

The first thing to do is make sure that your version of Perl was compiled with thread support.

The output from perl -V on my system includes the following lines:

C:\pwe>perl -V Summary of my perl5 (revision 5 version 10 subversion 0) configuration +: Platform: osname=MSWin32, osvers=5.2, archname=MSWin32-x64-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define,
and also:
Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_64_BIT_I +NT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_SITECUSTOMIZE
Once you are satisfied that your Perl supports threads, you might want to compare your code with this snippet from one of my programs (which happily uses quite a few threads) and see if comparing it with your code might help.
foreach my $seq (0..$number-1) { my $doneflag = \$play_done[$seq]; $$doneflag = 0; $play_list[$seq] = threads->create(\&PlayoutThread, $doneflag, $target_list[$seq], $media_type, $portnum, $playouts); # Mark as already done if thread creation failed unless ($play_list[$seq]) { $$doneflag = 2; $play_errors++; } # Count it if thread creation succeeded else { $started++; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://782737]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-16 06:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found