Weblog

All | General | Status | Java | Music | Politics
20031222 Monday December 22, 2003

Xerces DOM implementation is not thread safe for read only Couple of months back I wrote a test driver, which was using a single instance of DOM document and the test was reading some values and processing some other application logic. It was working fine until I ran the test in multiple threads. I started getting some unexpected errors from DOM objects. I used Xerces as DOM implementation.

Then I started reading the DOM spec. I found that there is no requirement for the DOM implementation to be thread safe(even for read-only purpose).

Usually everyone assumes that if we do read operations then it is thread safe as long as we do not do any write operation. But it is not true, it totally depends on what the read operation does.

Most of the time we use windows and the multi thread tests also pass, coz the chances of creating a race condition with a single processor machine is very less. I have noticed that the multi thread tests I ran on my laptop(single processor) with windows xp succeeds most of the time and they fail on IBM AIX(4 processors) most of the time.

Posted by nithy ( Dec 22 2003, 07:57:39 AM CST ) Permalink Comments [12129]

20031207 Sunday December 07, 2003

FIRST POST! This is my first post Posted by nithy ( Dec 07 2003, 08:41:30 PM CST ) Permalink Comments [5138]

Calendar

RSS Feeds

Search

Links

Navigation