marioroy / mce-perl

Many-Core Engine for Perl
Other
45 stars 5 forks source link

MCE::Loop and Visual Studio Code #15

Closed thalia2809 closed 2 years ago

thalia2809 commented 2 years ago

New here, so any advice appreciated. I have a code that uses MCE:Loop. However when I am trying to run this code in VScode debugger (using Perl Language Server) it will crash or do nothing. I get no error in the VScode Output or the Perl output or the Terminal. The VScode will either crash (without an error) or nothing will happen and the code won't even start to run. Any one else had the same issue? Thank you

marioroy commented 2 years ago

Hi. You can try adding "use threads;" at the top of the script. That will cause MCE to spawn threads instead. Sadly, forking inside the debugger doesn't work.

thalia2809 commented 2 years ago

Thanks, I tried and I m getting: "This Perl not built to support threadsCompilation failed in require .." I am using perl 5 v24 (v5.24.4) :/

marioroy commented 2 years ago

For threads to work, it requires the Perl binary to be compiled with threads support enabled.