|
|
Java Threads in EZ JComThere are some issues involved in Java thread processing and COM thread processing, that EZ JCom users should be aware of.EZ JCom simplifies the thread processing, so simple COM tasks require no attention to threading issues. However, for complex requirements, additional steps may be required. By default
Method Invocation SerializationOne serious implication of the default EZ JCom threading model is that only one COM method can be called at a time. Let us say you have two threads, and the first one calls Method1 and the second one calls Method2. Then EZ JCom will serialize both calls. Suppose Method1 gets called first. Then as long as Method1 does not return, it will not be possible for the Method2 invocation to go ahead! Method2 will be placed in a wait state.In some designs, this can be undesirable. There are two solutions:
Inefficient behavior with MTA objectsSome COM objects are designed for MTA model only. For such objects, using STA results in very inefficient behavior. If your methods are taking very long time to return, maybe switching to MTA is necessary. Check the documentation of your COM object to see if it requires MTA, and if necessary, set the environment variable, SET EZJCOM_MODE=MTA before starting the program. |