Memory consumption concern regarding asynchronous code in Perl
user44654 Published in September 20, 2018, 4:53 pm
I'm running a Perl web server which needs to do some work asynchronously. For this, I use the threads module in the following way:
# Asynchronous code here
I have some concerns regarding the correctness of this. Whenever I exit the server, I get the following message:
Perl exited with active threads:
0 running and unjoined
1 finished and unjoined
0 running and detached
I guess this has to do with the fact that I didn't joined or detached my thread. Detaching my thread would be a good solution but, unfortunately, it triggers this: https://bugzilla.redhat.com/show_bug.cgi?id=548249.
Now, here are my questions. Is there any problem with running the thread without joining or detaching it? Is it going to be a memory leak because of the unjoined/undetached threads? Should I run some cleanup code to take care of the finished threads?
Thank you in advance!
multithreading perl asynchronous memory
share|improve this question
asked Feb 14 at 7:04
Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.
Browse other questions tagged multithreading perl asynchronous memory or ask your own question.