This is our endless discussion. «Filehandles cannot be made 'shared'», maybe in your OS it works, not in the OS's i've tested. When you clone the Filehandle you are assuming that OS will sync the File->writes without any race conditions problems, but that is not true.
Updated:
This is what happens when removing the sleep()'s:
1: The time is 1258377733.481062
1: The time is 1258377733.481164
1: The time is 1258377733.481337
1: The time is 1258377733.4 3: The time is 1258377733.473267
3: The time is 1258377733.473595
3: The time is 1258377733.473749
3: The time is 1258377733.473885
3: The time is 1258377733.474008
3: The time is 1258377733.474110
3: The time is 1258377733.474212
3: The time is 1258377733.474313
In high concurrency level, the problems appear.
«A contentious debate is always associated with a lack of valid arguments.»
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.