I am using perl version 5.22 with cygwin. I am not able to figure out the problem in the following code. It looks like multi threading is not enable or something. When I ran the following code it just terminated without any message.
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); }
0 comments:
Post a Comment