From what I understand / can see your current multi-threading implementation is flawed. It appears you want to multi-thread sending data to servers, however for each server you want to send the data serially. At the moment, it looks like your implementation is to work through the servers serially and multi-thread the data being copied on each server

This is Not Good and using Thread::Queue won't solve your problem. You need to re-address your threading model. In fact, I would suggest you rebuild your application without using threading - Once its working, then add Thread::Queue to queue your list of servers, then add threads (with a static pool of threads) to do the work for each server.

Finally, you get the Free to wrong pool error because something you are doing (probably a library you are loading) is not thread safe. This can cause all sorts of problems, though there are potential workarounds (such as require'ing affected libraries after threads have been created, or only within the threads that need them).


In reply to Re: Queuing in multithread context by SimonPratt
in thread Queuing in multithread context by Hardin

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.