We don't bite newbies here... much | |
PerlMonks |
Re: Processing Two XML Files in Parallelby mirod (Canon) |
on Jul 22, 2011 at 07:08 UTC ( [id://916069]=note: print w/replies, xml ) | Need Help?? |
One way to do this is to use XML::Twig and Coro: have one thread parse the first input file and an other one parse the other one. Pass control between the 2 threads, after each elem has been parsed:
You will need to check that memory is indeed freed after each record. It should be OK, but I don't know exactly how Coro deals with memory, I had never used it before today. Thank you for asking this and making me look into the problem. And to whoever mentioned Coro yesterday in the CB. This is something I had wanted to do for a long time, but I had always deferred it since I did not really need it for work. Overall it was pretty painless though, the Coro intro is quite well written. update: also, I should have read Tanktalus answer, above, since he obviously knows Coro a lot better than I do. I am still happy I answered though, at least I learned something.
In Section
Seekers of Perl Wisdom
|
|