ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Logging and synchronization
Date Fri, 11 Jul 2008 16:00:20 GMT
On Fri, 11 Jul 2008, <> wrote:

> XmlLogger could lose messages when parallel is used.

Since DOM is not thread safe (something I didn't fully realize) our
XMLLogger implementation failed to add a few elements when parallel
was used.  I've now synchronized all appendChild calls and it seems to
work OK.

Of course this means XmlLogger will now be synchronized even if you
don't use parallel at all - or fork processes which could generate
messageLogged events from a separate thread, or do anything else that
happens on a separate thread.

Do you think it would be worth it if we added a SynchronizedXmlLogger
and ask people to use that if they intend to do multithreaded things?
Or do we just swallow the performance impact of synchronization?

BTW, all the other loggers are vulnerable to this as well.
DefaultLogger will happily mix log outputs of several messages - in
particular now that trunk no longer serializes the messageLogged


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message