Looking at the code some more I wonder:

  *    if defaultThreadFactoty should use a Thread group for the pool or at 
least for NIO?
  *   If it can skip the security manager check and use InnocousThread in all 
cases (to avoid ThreadLocals - not sure if some encode cache is hurt by it?)

  *   If it can skip the priveledged call as IThread does that itself.

https://github.com/openjdk/jdk/blob/6765f902505fbdd02f25b599f942437cd805cad1/src/java.base/share/classes/sun/nio/ch/ThreadPool.java#L76

--
http://bernd.eckenfels.net
________________________________
Von: Bernd Eckenfels <[email protected]>
Gesendet: Sunday, October 17, 2021 4:56:17 AM
An: OpenJDK Dev list <[email protected]>; [email protected] 
<[email protected]>
Betreff: InnocuousThread names (was: [8u] RFR 8190482: InnocuousThread creation 
should not require the caller to possess enableContextClassLoaderOverride)

Apropos InnocousThread backporting - I Wonder if we should remove the auto 
threadname infrastructure and only create properly named threads. The generic 
name seems to be rather confusing and it seems it is only used in an NIO Pool, 
where a thread-name should be set, anyway?

https://github.com/openjdk/jdk/blob/6765f902505fbdd02f25b599f942437cd805cad1/src/java.base/share/classes/sun/nio/ch/ThreadPool.java#L86

Gruss
Bernd
--
http://bernd.eckenfels.net
________________________________
Von: jdk8u-dev <[email protected]> im Auftrag von Zhengyu Gu 
<[email protected]>
Gesendet: Sunday, October 17, 2021 1:39:12 AM
An: Hohensee, Paul <[email protected]>; jdk8u-dev <[email protected]>
Betreff: Re: [8u] RFR 8190482: InnocuousThread creation should not require the 
caller to possess enableContextClassLoaderOverride

Thanks, Paul

-Zhengyu


On 10/15/21 17:30, Hohensee, Paul wrote:
> Lgtm.
>
> Thanks,
> Paul
>
> -----Original Message-----
> From: jdk8u-dev <[email protected]> on behalf of Zhengyu Gu 
> <[email protected]>
> Date: Tuesday, October 5, 2021 at 8:12 AM
> To: jdk8u-dev <[email protected]>
> Subject: [8u] RFR 8190482: InnocuousThread creation should not require the 
> caller to possess enableContextClassLoaderOverride
>
> This backport is for parity with Oracle 8u321.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8190482
> Webrev: http://hg.openjdk.java.net/jdk/jdk/rev/5e7cf99b1303
>
> The original patch does not apply cleanly. There is not newThread(String
> name, Runnable target) method in 8u, so discard this part of change.
>
>
> 8u webrev: http://cr.openjdk.java.net/~zgu/JDK-8190482-8u/webrev.00/
>
>
> Thanks,
>
> -Zhengyu
>
>

Reply via email to