|
|
| Do you know where your variables are? | |
| PerlMonks |
Re^11: [threads] Open a file in one thread and allow others to write to itby ikegami (Pope) |
| on Nov 16, 2009 at 17:45 UTC ( #807525=note: print w/ replies, xml ) | Need Help?? |
|
There's no race condition there. Notice the timestamps aren't in order? You never ask Perl to write to disk, so it writes in 4k chunks, whether the chunk ends in the middle of a line or not. Simplest solution: Change to
If you're still having jumbled output after fixing the above problem, there might be a problem keeping file pointers in sync. Use the following before the print:
I don't think it'll come to that, though.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||