Scoped variables

David Holmes david.holmes at
Tue Dec 4 05:46:16 UTC 2018

Hi Doug,

On 4/12/2018 10:57 am, Doug Lea wrote:
> On 12/3/18 2:55 PM, John Rose wrote:
>> In part we are drawing on the very old idea of a Lisp "SPECIAL" variable.
> While people are contemplating alternatives, it would be great to see
> post-mortem evaluations of RTSJ Scoped Memory (which had similar
> ambitions), by people who implemented and used it. 

That's a very small set of people - as well you know :)

RTSJ Scoped Memory is somewhat of a different beast to general 
"context"-local variables - where a context may be a thread, a fiber, a 
session, etc.

RTSJ Scoped Memory actually allocated the objects into a memory region 
that had a lifetime that was connected to the active execution of the 
current thread. They were intended to act more like stack allocated Java 
objects, and came with significant restrictions on assignment and use as 
shorter-lived instances could not be assigned to fields of longer lived 
instances, nor returned up the call stack beyond the start of the 
allocation scope. (And a complex tree-based memory region management 
scheme, that allowed controlled sharing across threads, made things even 
more complex!)

"context"-locals on the other hand don't deal with allocation at all, 
they are simply "maps" from the current-"context" to a named variable.

I'm not sure what Loom "Scoped variables" are intended to be exactly.

> In the mean time, try googling "RTSJ scoped memory".

Made me feel quite nostalgic :)


> -Doug

More information about the loom-dev mailing list