Posted: Wed Jul 02, 2008 5:33 am Post subject: is Java Compute Node Thread Safe
Voyager
Joined: 28 Nov 2004 Posts: 76
When adding additional msgflow instances on WMB AIX 6.1, the IPROCS indicator matches the number of instances specified in the bar file and we can see that multiple threads are running in the java compute node by printing out the thread-id unfortunately we keep getting core files and unpredictable results
Do people use the java compute node in high volume production systems. Is this practical.
The info center has this statement
"Only one instance of the JavaCompute node is created regardless of the number of threads running against the flow (either as a result of additional instances or multiple input nodes)." Does this mean that java compute nodes are synchronized?
Please share your experiences re: java compute node - should we persue this approach or stay with ESQL
The evaluate method is definetely not synchronized, otherwise there would be only one thread running it at a time. You could not scale the flow by allowing more instances. If you need to access common resources or do something else in a sychronized manner, you must take care of sychronization yourself. Make sure you sychronize the absolute minimum of code to avoid creating a bottleneck. The JVM will allow only one thread at a time to run the synchronized block.
...confirmed your assertion by printing out Thread.currentThread().getname(). The thread id displayed matches the number of instances specified. So if I have three threads, three separate thread ids are displayed in the log
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum