Please prefix email subjects with [SCXML], this is probably OK now since it would be somewhat redundant :-)
On 3/27/07, Elam Birnbaum (ebirnbau) <[EMAIL PROTECTED]> wrote:
Hello, While we are on the subject of threads and concurrency, I would like to ask if Commons SCXML itself spawns off threads and if so when and it is possible to give the user control over that.
<snip/> Commons SCXML has many usecases in web / application server environments and is extra careful about not spawning threads (unless the developer makes specific choices -- see below). The short answer is no. Everything with respect to threads is in the user's control.
I know from a previous e-mail thread I started that the proper way to trigger events on the state engine is via another thread and that is fine since that thread spawning is under user control. I am more concerned about any threads Commons SCXML itself spawns for its own purposes, if any, even if they are short-lived. My system is sensitive to total threads spawned (my component is a small part of a bigger project that could all run under the same JVM) so I'd just like to be aware of how Commons SCXML deals with its own threads so I am prepared.
<snap/> When an SCXMLExecutor is instantiated, it is not equipped to spawn threads at all. However, the specification requires certain things like: 1) Invoking external processes in an unrelated context 2) Introducing a delay before some event is sent For (1), the user registers invoker classes for each targettype with the executor. An example is SimpleSCXMLInvoker (which invokes a SCXML document in its own context by spawning a thread) but the user has to actively make the decision to use it (by registering this invoker for targettype "scxml") For (2), the user registers an EventDispatcher with the executor that is capable of processing delays. An example is provided (SimpleScheduler) that uses J2SE Timers, but again the user has to actively make the decision to register this dispatcher. -Rahul
Thanks, Elam Birnbaum
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
