[
https://issues.apache.org/jira/browse/UIMA-5842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16554245#comment-16554245
]
Marshall Schor edited comment on UIMA-5842 at 7/24/18 2:07 PM:
---------------------------------------------------------------
Some thoughts on how this might be implemented.
There are many ways to modify a CAS: create or update FeatureStructures (FSs)
, add/remove FSs to indexes, create views, reset, replace a type system (done
by cas complete deserialization), get/return a CAS to/from a CasPool. Others?
* This mode might be set for any / all of these categories.
One task is finding (hopefully a few) points in the code base where to insert
an "isAllowed" test.
Consideration for that test:
* (simplest) a CAS boolean field. (problem: multiple threads won't see
consistent view)
* volatile CAS boolean field (problem: each read forces a read-from-memory -
potentially slow)
* use a MutableCallSite to return the is-allowed value, using the "syncAll"
method when changing it to make values visible in other threads. This seems
the best (so far).
The test might need to be conditioned on the current Thread - e.g. no-access
for most threads, but read-write access for one particular thread.
was (Author: schor):
Some thoughts on how this might be implemented.
There are many ways to modify a CAS: create or update FeatureStructures (FSs)
, add/remove FSs to indexes, create views, reset, replace a type system (done
by cas complete deserialization), get/return a CAS to/from a CasPool. Others?
* This mode might be set for any / all of these categories.
One task is finding (hopefully a few) points in the code base where to insert
an "isAllowed" test.
Consideration for that test:
* (simplest) a CAS boolean field. (problem: multiple threads won't see
consistent view)
* volatile CAS boolean field (problem: each read forces a read-from-memory -
potentially slow)
* use a MutableCallSite to return the is-allowed value, using the "syncAll"
method when changing it to make values visible in other threads. This seems
the best (so far).
> No-access, Read-only-access modes for a CAS
> -------------------------------------------
>
> Key: UIMA-5842
> URL: https://issues.apache.org/jira/browse/UIMA-5842
> Project: UIMA
> Issue Type: Wish
> Components: Core Java Framework
> Reporter: Marshall Schor
> Priority: Minor
>
> This Jira refs UIMA-5763 having motivation and discussion for no-access and
> read-only-access flags for a CAS. UIMA-5763 is rescoped to its original
> title, specific to releasing CASes.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)