AppContext issue in Apple Java 6 -- same issue in Oracle Java 7?

Artem Ananiev artem.ananiev at oracle.com
Tue Jul 9 07:43:03 PDT 2013


On 7/7/2013 8:50 PM, Andrew Thompson wrote:
>
> On Jul 3, 2013, at 5:18 AM, Artem Ananiev wrote:
>
>> 2. In applet/webstart modes, there may be multiple AppContexts in
>> the JVM. All the application code is supposed to run in a single
>> AppContext, including all the helper threads running native code.
>> If you create a new thread group, it will inherit the current
>> AppContext. If you create a new thread group using another (not
>> current) thread group as a parent... Well, you should not do that,
>> and, actually, untrusted code is not allowed to do that.
>
> But I can deploy trusted code by signing an applet or a webstart
> application and it can create a Thread in another ThreadGroup.
> Elsewhere in this thread people mention JNI and RMI threads and
> Cocoa's main thread. This is all valid code; there's no prohibitions
> against doing any of these things.

Even if an applet is signed and has all permissions, I don't think it 
should create new threads in, say, Java Plugin thread group, right? Note 
that AppContext is a little bit more complex than a plain Map <-> 
ThreadGroup mapping. A single AppContext can occupy multiple thread 
groups, so if you create a thread in a nested thread group, you will be 
fine.

RMI and other issues mentioned in this thread should be fixed, indeed.

> I understand it is intended that this AppContext idea is transparent
> and ideally it would be. But at the present time it appears that the
> abstraction leaks [1] and there is no workarounds possible using
> supported code (rather than sun.* classes). Have I misunderstood
> something in this thread?
>
> My feeling is this is something Oracle needs to address.

Agree.

Thanks,

Artem

> [1] http://www.joelonsoftware.com/articles/LeakyAbstractions.html
>
> AndyT (lordpixel - the cat who walks through walls) A little bigger
> on the inside
>
> (see you later space cowboy, you can't take the sky from me)
>
>


More information about the macosx-port-dev mailing list