Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Multithreading cygwin perl支持多线程_Multithreading_Perl_Cygwin - Fatal编程技术网

Multithreading cygwin perl支持多线程

Multithreading cygwin perl支持多线程,multithreading,perl,cygwin,Multithreading,Perl,Cygwin,我在cygwin中使用perl版本5.22。我无法在下面的代码中找出问题所在。看起来多线程是不启用的。当我运行下面的代码时,它只是在没有任何消息的情况下终止 use warnings; use threads; sub threaded_task { threads -> create(sub { print "Starting thread\n"; sleep(2); print "Ending thread\n";

我在cygwin中使用perl版本5.22。我无法在下面的代码中找出问题所在。看起来多线程是不启用的。当我运行下面的代码时,它只是在没有任何消息的情况下终止

use warnings;
use threads;

sub threaded_task {

    threads -> create(sub { 

        print "Starting thread\n";
        sleep(2);
        print "Ending thread\n";


    });
 }

while(1) {
threaded_task("arjun");
print "main thread\n";
sleep (2); 
}
64位配置:

32位配置:

您是如何运行代码的?使用cygwin终端,键入:perl filename.plt其他perl脚本正常吗?您的脚本在Linux上运行正常(手头没有cygwin机器)。但不知道如何配置它。我无法为您调试
perl
;它在我的机器上工作。你是如何运行代码的?使用cygwin终端键入:perl filename.plt其他perl脚本工作正常吗?您的脚本在Linux上运行正常(手头没有cygwin机器)。但不知道如何配置它。我无法为您调试
perl
;它在我的机器上工作。