On 17/10/2021 04:24, Bernd Eckenfels wrote:
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.


Changing it to use InnocousThread unconditionally would likely change the performance profile as TLs would be cleared so I don't think we should change that. The SM is terminally deprecated and there will be cleaned required right across the JDK once it is eventually removed, it is possible that many usages of InnocousThread will no longer be needed. You may be right that it no longer needs the doPriv to create the InnocousThread, it looks like the code changed but some of the use-sites were not updated.

-Alan

Reply via email to