Using Nested Scoped Memory

A scoped memory area is activated for allocation by its enter method and becomes inactive when the enter method returns. When it is used this way, the scoped memory is a nested scope.

Assignment rules (see Table 13-1) are governed by what behaves like a stack of nested memory areas.

You can nest memory areas any way you like provided that they follow the single parent rule. The scope's enter method throws a ScopedCycleException if it is called on a memory area that any thread has already entered from a different scope.

In its full complexity, supporting the single parent rule and the assignment rules require two types of data structures: a directed acyclic graph (DAG) shared by the all threads and a tree per thread. ...

Get Real-Time Java™ Platform Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.