I'm not sure what your threads are supposed to do with the currently running requests. I would let them finish their current request and have them recheck a global, shared flag whether to pause or (re)start processing. A more convoluted alternative would be to $queue->unshift dummy jobs on the threads work queue that tell each thread to pause.
If the request really is "stop whatever you're doing", have a look at the "suspend" example in threads. It seems to use signals, but as the signals are claimed to stay within the confines of Perl and seem not to be OS signals, these should be saner/safer to use with threads.
If the request only means "don't update the widget", that's easy. Have your threads send the updates to the main program through a Thread::Queue, and then either fetch or discard the log updates from that queue.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||