You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2016/08/19 21:50:23 UTC

svn commit: r1756969 - /uima/uimaj/trunk/uima-docbook-references/src/docbook/ref.cas.xml

Author: schor
Date: Fri Aug 19 21:50:23 2016
New Revision: 1756969

URL: http://svn.apache.org/viewvc?rev=1756969&view=rev
Log:
no Jira - add secton on limited multi-threaded access to read-only CASs to the reference doc.

Modified:
    uima/uimaj/trunk/uima-docbook-references/src/docbook/ref.cas.xml

Modified: uima/uimaj/trunk/uima-docbook-references/src/docbook/ref.cas.xml
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uima-docbook-references/src/docbook/ref.cas.xml?rev=1756969&r1=1756968&r2=1756969&view=diff
==============================================================================
--- uima/uimaj/trunk/uima-docbook-references/src/docbook/ref.cas.xml (original)
+++ uima/uimaj/trunk/uima-docbook-references/src/docbook/ref.cas.xml Fri Aug 19 21:50:23 2016
@@ -1107,4 +1107,25 @@ FSIterator it = cas.createFilteredIterat
     with the same name can be merged only if their features can be merged.
     </para>
     </section>
+    
+  <section id="ugr.ref.cas.limitedmultipleaccess">
+    <title>Limited multi-thread access to read-only CASs</title>
+    
+    <para>Some applications may find it useful to scale up pipelines and run these in parallel.</para>
+    <para>
+    Generally, CASs are not threadsafe, and only one thread at a time may operate on it.  In many
+    scenarios, a CAS may be initialized and then filled with Feature Structures, and after some point,
+    no more updates to that particular CAS will be done.</para>
+    
+    <para>
+    If a CAS is no longer going to be changed, it is possible to 
+    access it on multiple threads in a read-only mode, simultaneously, with some limitations.  Limitations 
+    arise because some UIMA Framework activities may update internal CAS data structures.</para>
+    
+    <para>Operational data is updated while running a pipeline when a PEAR is entered or exited, 
+    because PEARs establish new class loaders and can potentially switch the JCas classes being used.
+    Because of this, you cannot have multiple pipelines accessing a CAS in read-only mode if one or more of those
+    pipelines contains a PEAR. 
+    </para>
+    </section>
 </chapter>
\ No newline at end of file



Re: svn commit: r1756969 - /uima/uimaj/trunk/uima-docbook-references/src/docbook/ref.cas.xml

Posted by Marshall Schor <ms...@schor.com>.
now says:

    Operational data is updated while running a pipeline when a PEAR is entered
or exited,
    because PEARs establish new class loaders and can potentially switch the
JCas classes being used
    (This happens because the class loaders might define different JCas cover
classes
    implementing the same UIMA type).
    Because of this, you cannot have multiple pipelines accessing a CAS in
read-only mode if one or more of those
    pipelines contains a PEAR. There are other edge cases where this may happen
as well; for example, if you are
    running a pipeline with an Extension Class Loader,
    and have a callback routine loaded under a different class loader, UIMA will
switch the JCas classes when
    calling the callback.

-Marshall

On 8/21/2016 1:51 PM, Marshall Schor wrote:
> You are correct, in the edge case we saw earlier that triggered this line of
> thinking.
>
> If a user constructs a pipeline without PEARs, all the user code called by the
> framework is normally also loaded by the UIMA framework via that extension class
> loader. So normally, components using a resource manager with a custom extension
> classloader won't encounter this. 
>
> But I'll take a crack at adding this to the docs... :-)
>
> -Marshall
>
> On 8/19/2016 5:59 PM, Richard Eckart de Castilho wrote:
>> On 19.08.2016, at 23:50, schor@apache.org wrote:
>>> +    <para>Operational data is updated while running a pipeline when a PEAR is entered or exited, 
>>> +    because PEARs establish new class loaders and can potentially switch the JCas classes being used.
>>> +    Because of this, you cannot have multiple pipelines accessing a CAS in read-only mode if one or more of those
>>> +    pipelines contains a PEAR. 
>> This applies to any components using a resource manager with a custom extension classloader, right?
>> PEARs are only one specific case in which an extension classloader is being used.
>>
>> Cheers,
>>
>> -- Richard
>


Re: svn commit: r1756969 - /uima/uimaj/trunk/uima-docbook-references/src/docbook/ref.cas.xml

Posted by Marshall Schor <ms...@schor.com>.
You are correct, in the edge case we saw earlier that triggered this line of
thinking.

If a user constructs a pipeline without PEARs, all the user code called by the
framework is normally also loaded by the UIMA framework via that extension class
loader. So normally, components using a resource manager with a custom extension
classloader won't encounter this. 

But I'll take a crack at adding this to the docs... :-)

-Marshall

On 8/19/2016 5:59 PM, Richard Eckart de Castilho wrote:
> On 19.08.2016, at 23:50, schor@apache.org wrote:
>> +    <para>Operational data is updated while running a pipeline when a PEAR is entered or exited, 
>> +    because PEARs establish new class loaders and can potentially switch the JCas classes being used.
>> +    Because of this, you cannot have multiple pipelines accessing a CAS in read-only mode if one or more of those
>> +    pipelines contains a PEAR. 
> This applies to any components using a resource manager with a custom extension classloader, right?
> PEARs are only one specific case in which an extension classloader is being used.
>
> Cheers,
>
> -- Richard


Re: svn commit: r1756969 - /uima/uimaj/trunk/uima-docbook-references/src/docbook/ref.cas.xml

Posted by Richard Eckart de Castilho <re...@apache.org>.
On 19.08.2016, at 23:50, schor@apache.org wrote:
> 
> +    <para>Operational data is updated while running a pipeline when a PEAR is entered or exited, 
> +    because PEARs establish new class loaders and can potentially switch the JCas classes being used.
> +    Because of this, you cannot have multiple pipelines accessing a CAS in read-only mode if one or more of those
> +    pipelines contains a PEAR. 

This applies to any components using a resource manager with a custom extension classloader, right?
PEARs are only one specific case in which an extension classloader is being used.

Cheers,

-- Richard