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.

~Arun

In reply to perl thread hangs/not spawned by arunb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.