arunb has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, I have a perl application that is a web-server. As usual, it accepts connections and for each connection, spawns a thread and detaches the thread. The thread subroutine then performs the required operations and exits.
Now this works fine in my application. We have a scenario where we do a file upload to the web server from the front-end. So when the request comes to back-end, i spawn a thread to download the file to the back-end server. Then i spawn another thread from this thread which will do some pre-processing on the downloaded file.After spawning, i detach it as well.( I am not so concerned about the return status of pre-processing.)
When the file size is around 5-6MB, there is no problem. This works fine. When i try to upload a 13MB file, the second thread ( for pre-processing ) does not get spawned. The threads->create() subroutine does not create a new thread. It seems to hang. The interesting part is when i get another request from front-end, the web server spawns a new thread and then i see that the previously hung thread wakes up and starts execution. I am stuck at this stage. Please help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl thread hangs/not spawned
by moritz (Cardinal) on Oct 15, 2009 at 12:58 UTC | |
by arunb (Initiate) on Oct 15, 2009 at 13:24 UTC | |
|
Re: perl thread hangs/not spawned
by bart (Canon) on Oct 15, 2009 at 13:34 UTC | |
by arunb (Initiate) on Oct 16, 2009 at 05:56 UTC |