commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nestor Urquiza <>
Subject Re: [SCXML] Executor is thread safe?
Date Thu, 22 Mar 2007 09:34:09 GMT
> Sounds about right, assuming call == (http) request
> etc.
Correct ...

>    if (executor is not present) {
>       instantiate it
>       set root context, evaluator, state machine
> etc.
>       // the class doesn't synchronize these init
> time operations
>    }
>    use executor -- trigger events, reset etc. //
> these are synchronized
Exactly what I do ...

> TBD whether this distinction is intuitive. But it
> does seem (from the
> comment below) that you're not treating
> setRootContext() as a one-time
> operation. 
Correct ...

>Can you try synchronizing on the executor
> instance before
> you update / change the root context in subsequent
> requests? Do these
> contexts reference shared variables / data? --
> generally shouldn't and
> if they do the data should either be immutable or
> synchronized
> appropriately.
I found the problem and it was related precisely to
references to shared data (an implementation bug
because of a design concept violation). 

Basically I am digesting a settings xml file which
holds static configuration. By mistake one of the
resulting objects is used to carry extra information
that is very specific to the particular call. 

Of  course the clean solution is to use a separate
object which by composition refers to the first one
and adds its own data. The quick and dirty
(inneficient one) is to make a copy of the first one
and use itas the second one.



Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.

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

View raw message