Why does OSThread exist?

Thomas Stüfe thomas.stuefe at gmail.com
Tue Dec 7 13:56:41 UTC 2021


Hi David,

On Tue, Dec 7, 2021 at 10:25 AM David Holmes <david.holmes at oracle.com>
wrote:

> Hi Thomas,
>
> On 7/12/2021 4:30 pm, Thomas Stüfe wrote:
> > Hi,
> >
> > does anybody know what the point is of a separate OSThread companion
> class
> > to Thread? I understand that there is OS-specific information one wants
> to
> > factor out on a per-platform base, but why two physically separate
> > structures? AFAICS they never exist separately (an OSThread makes no
> sense
> > without a Thread, and vice versa). We pay unnecessarily for two
> > allocations, C-heap fragmentation, and for one additional dereferencing
> hop
> > when accessing OSThread.
>
> Can say for sure as it is historical - it's just the way the OS specific
> part was factored out.
>
> We had a project to try and get rid of it a few years ago but it wasn't
> a clean/simple as thought at the time and the project was dropped. But
> Solaris complicated things and now that's gone so ...
>
>
Thanks for the explanation. This tickles my cleanup sense and maybe I try
my hands on it, now Solaris is gone.

Cheers, Thomas



> Cheers,
> David
>
> > Thanks, Thomas
> >
>


More information about the hotspot-runtime-dev mailing list