Re: Exceptions due to freemarker's use of non-thread-safe DOM library
Daniel Dekany <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Friday, June 3, 2011, 9:38:59 PM, Newman, John W wrote: [snip] > If there’s not a thread safe lib out there, I’ll try to get > something going with the cglib proxy. Good suggestion. Is there a > better approach to sharing an xml document to multiple threads? [snip] If your application spends significant time with XML processing with multiple cores, then maybe you get better performance if you crate a single "master" DOM Document, then populate a pool with clones made with clone() or cloneNode(true) (*if* that works well in Xerxes when you clone the whole Document, not just an Element). Then the threads can borrow their own clone from that pool. You could even pool the already wrapped (by FreeMarker) Documents, so you can even avoid the wrapping overhead. -- Best regards, Daniel Dekany ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Discover what all the cheering's about. Get your free trial download today. http://p.sf.net/sfu/quest-dev2dev2 _______________________________________________ FreeMarker-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freemarker-user