I enterd in the Reader the line:
next if ($NoClient < 2);
for speed and for 'economical' reasons. If only 1 Client is 'chatting' that would mean (for my purpos: sending results that have to be added to file - this part I elimiated), that there is no need to push anything into @chat.
But you just can skip this line without any side effects. @chat would only be a bit bigger and the Writer is called just to eliminate those lines: I think the Writer gets a signal on (or by?) cond_wait, he will try to send those lines but won't send them because the lines are from his corresponding reader, then those lines are deleted.
This cannot be responsible for the fact that some time ago sometimes a Writer did not die. The Reader leaves the loop when his socket broke, then outeside the loop he is pushing the 'kill-code' into @chat and this should call the Writer. He detects the 'kill-code' together with his ID and he will leave the loop. Due to the fact that he is the last to die, the Writer does all the admin stuff, I think it's usefull that way.
carl
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.