[ 
https://issues.apache.org/jira/browse/UIMA-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jerry Cwiklik reopened UIMA-1223:
---------------------------------


Current synchronization approach to guard UIMAFramework.produceAnalysisEngine() 
from being accessed by multiple threads is not working. The current approach 
synchronizes access to the above by using instance variable called mux of type 
Object. This works fine in the top level UIMA AS primitive controller where 
there is always a single instance producing AEs. In the UIMA AS aggregate 
controller there may be multiple instances of   UIMA As primitive controller. 
There is a chance that these instances can initialize their AEs at the same 
time and access UIMA core's code that is not thread safe. Synchronize access to 
UIMAFramework.produceAnalysisEngine() using static semaphore instance with a 
single permit. There will be a single instance of the semaphore per jvm 
guaranteeing correct serialized access to the core's code. 


> Annotators should be initialized in the same thread that their process method 
> will later be called on
> -----------------------------------------------------------------------------------------------------
>
>                 Key: UIMA-1223
>                 URL: https://issues.apache.org/jira/browse/UIMA-1223
>             Project: UIMA
>          Issue Type: Bug
>          Components: Async Scaleout
>    Affects Versions: 2.2.2
>            Reporter: Adam Lally
>            Assignee: Jerry Cwiklik
>            Priority: Minor
>             Fix For: 2.3AS
>
>         Attachments: uimaj-as-activemq-UIMA-1223-patch.txt, 
> uimaj-as-core-UIMA-1223-patch.txt
>
>
> It is more convenient if an annotator is initialized on the same thread that 
> it is later called on.  Some components may use thread-local data and they 
> won't work in UIMA-AS currently.  Another advantage of doing the 
> initialization in the processing thread is that you could initialize multiple 
> instances of the annotator in parallel instead of sequentially, which may be 
> faster for a multi-core machine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to