Author |
Message
|
fenway_frank |
Posted: Fri Mar 30, 2012 1:15 pm Post subject: thread safety of environment tree variables |
|
|
 Apprentice
Joined: 21 Oct 2011 Posts: 43 Location: Boston, MA USA
|
hello.
is the environment tree structure (especially the 'variables' subtree) thread safe? if i assign a variable within an esql node, i presume the assignment itself is thread safe within the execution of the message flow. most important, subsequent requests/instantiations of same msgflow will create a separate environment tree. that is my understanding, pls confirm.
also, why doesn't jcn support access to the same environment tree? |
|
Back to top |
|
 |
mgk |
Posted: Fri Mar 30, 2012 1:18 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
is the environment tree structure (especially the 'variables' subtree) thread safe |
Yes
Quote: |
if i assign a variable within an esql node, i presume the assignment itself is thread safe within the execution of the message flow |
Yes
Quote: |
most important, subsequent requests/instantiations of same msgflow will create a separate environment tree |
Yes, a new Environment tree is created for each message through a flow.
Quote: |
that is my understanding, pls confirm |
Done.
Quote: |
why doesn't jcn support access to the same environment tree? |
It does, look again at the API.
Kind Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
fenway_frank |
Posted: Fri Mar 30, 2012 1:25 pm Post subject: |
|
|
 Apprentice
Joined: 21 Oct 2011 Posts: 43 Location: Boston, MA USA
|
@mgk - thx for quick reply. if i increase the number within msgflow "additional instances" property > 0, my understand is that (1+additional instances) message flow instances are instantiated at eg startup and ready to receive traffic. how, if at all, does this effect the behavior of the environment tree? thx! |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Mar 30, 2012 1:38 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
fenway_frank wrote: |
@mgk - thx for quick reply. if i increase the number within msgflow "additional instances" property > 0, my understand is that (1+additional instances) message flow instances are instantiated at eg startup and ready to receive traffic. how, if at all, does this effect the behavior of the environment tree? thx! |
I doesn't because as stated the tree is threadsafe...
Now if you are playing with Shared variables, then the content (of the shared variables) is no longer "thread-safe" as it can be changed by the other instances of the flow...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
fenway_frank |
Posted: Fri Mar 30, 2012 1:41 pm Post subject: |
|
|
 Apprentice
Joined: 21 Oct 2011 Posts: 43 Location: Boston, MA USA
|
yes, understood that shared variables are another matter altogether.
thx for answering my questions. |
|
Back to top |
|
 |
fenway_frank |
Posted: Fri Mar 30, 2012 6:02 pm Post subject: |
|
|
 Apprentice
Joined: 21 Oct 2011 Posts: 43 Location: Boston, MA USA
|
Just to be crystal clear, my prior questions were specifically targeting the Environment tree and not the Local Environment Tree. Both have concept of variables "scratch pad" section but i intend to use Environment.variables (not LocalEnvironment.variables) to carry custom data across the message flow. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Mar 31, 2012 6:14 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
fenway_frank wrote: |
Just to be crystal clear, my prior questions were specifically targeting the Environment tree and not the Local Environment Tree. Both have concept of variables "scratch pad" section but i intend to use Environment.variables (not LocalEnvironment.variables) to carry custom data across the message flow. |
It is thread safe and different for each instance of the flow.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Sat Mar 31, 2012 10:03 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
fenway_frank wrote: |
Just to be crystal clear, my prior questions were specifically targeting the Environment tree and not the Local Environment Tree. Both have concept of variables "scratch pad" section but i intend to use Environment.variables (not LocalEnvironment.variables) to carry custom data across the message flow. |
Just to be crystal clear.
BOTH TREES ARE COMPLETELY THREAD SAFE. |
|
Back to top |
|
 |
rekarm01 |
Posted: Sun Apr 01, 2012 3:44 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
mqjeff wrote: |
Just to be crystal clear.
BOTH TREES ARE COMPLETELY THREAD SAFE. |
Before anyone asks, the Root and ExceptionList trees are also completely thread safe.
However, this only applies to threads created by the broker itself. Within a message flow instance, an external procedure, non-ESQL compute node, or user-defined extension could create its own threads, unbeknownst to the broker, but these non-broker threads must not use the broker API to access any message trees. |
|
Back to top |
|
 |
|