in reply to Multithreaded xml writing using XML::Writer
No. No. Yes. Yes, by starting again and doing things differently.
Sharing an object ($writer), via closure, means that each thread gets its own copy of the object. Now if the object needs to remember any information internally, say about what it has already done, then each copy will not know what the other copy has done, and both will get very confused.
Also, lock() can only be used upon shared variables. And since you aren't using threads::shared, you should probably be getting warnings about the way you are using it. If you aren't, then it must mean you aren't using warnings either, and that is a very unwise decision if you intend to use threading.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Multithreaded xml writing using XML::Writer
by DreamT (Pilgrim) on May 03, 2010 at 11:47 UTC | |
by Corion (Patriarch) on May 03, 2010 at 11:51 UTC | |
by DreamT (Pilgrim) on May 03, 2010 at 12:02 UTC | |
by BrowserUk (Patriarch) on May 03, 2010 at 12:02 UTC | |
by DreamT (Pilgrim) on May 03, 2010 at 12:18 UTC | |
by BrowserUk (Patriarch) on May 03, 2010 at 12:22 UTC | |
by DreamT (Pilgrim) on May 03, 2010 at 13:52 UTC | |
|