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 <e...@zusammenkunft.net>
Gesendet: Sunday, October 17, 2021 4:56:17 AM
An: OpenJDK Dev list <core-libs-dev@openjdk.java.net>; nio-...@openjdk.java.net 
<nio-...@openjdk.java.net>
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 <jdk8u-dev-r...@openjdk.java.net> im Auftrag von Zhengyu Gu 
<z...@redhat.com>
Gesendet: Sunday, October 17, 2021 1:39:12 AM
An: Hohensee, Paul <hohen...@amazon.com>; jdk8u-dev <jdk8u-...@openjdk.java.net>
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 <jdk8u-dev-r...@openjdk.java.net> on behalf of Zhengyu Gu 
> <z...@redhat.com>
> Date: Tuesday, October 5, 2021 at 8:12 AM
> To: jdk8u-dev <jdk8u-...@openjdk.java.net>
> 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