On Feb 5, 2008 7:40 AM, Tom McCallum <[EMAIL PROTECTED]> wrote:

> Quick question of style really.  I have created an app which has a large
> amount of interaction between Java and Batik.  I do all my
> 'setAttributeNS' statements in the updatemanager thread, and
> 'getAttributeNS' statements outside of this thread.
>
> Obviously this leads to some situations where the sub-thread with the
> 'setAttributeNS' statement has not been completely executed at the time of
> the 'getAttributeNS' statement in the java code.
>
>
Here's a "quick hack" idea that is gross but may work... put all of your
invocations to setAttributeNS() and getAttributeNS() (in either thread)
inside a synchronized() block (locking the same object of course). This
should at least prevent exceptions thrown in the reader thread and give you
some valid answer, although of course it doesn't eliminate the fact that you
are creating an inherent race condition.

-- 
Archie L. Cobbs

Reply via email to