in reply to Re^2: [threads] Open a file in one thread and allow others to write to it
in thread [threads] Open a file in one thread and allow others to write to it
S'funny, cos the code I posted is very well tested (going back to 5.8.0 and right upto 5.8.9 & 5.10.1 (64-bit)!
The mistake you're making is reading "Filehandles cannot be made 'shared'." to mean 'filehandles cannot be shared'. Those phrases do not be not mean the same thing.
Filehandles are process global entities and therefore can be cloned. Which means that each thread created after a filehandle comes into existance gets it's own copy of the global.
Try the code I posted. Tell me how you get on :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: [threads] Open a file in one thread and allow others to write to it
by gulden (Monk) on Nov 16, 2009 at 13:14 UTC | |
by BrowserUk (Patriarch) on Nov 16, 2009 at 13:23 UTC | |
by gulden (Monk) on Nov 16, 2009 at 13:37 UTC | |
by BrowserUk (Patriarch) on Nov 16, 2009 at 13:56 UTC | |
|