software threads vs hardware threads

Software threads are threads of execution managed by the operating system.

Hardware threads are a feature of some processors that allow better utilisation of the processor under some circumstances. They may be exposed to/by the operating system as appearing to be additional cores (“hyperthreading”).

In Java, the threads you create maintain the software thread abstraction, where the JVM is the “operating system”. Whether the JVM then maps Java threads to OS threads is the JVM’s business (but it almost certainly does). And then the OS will be using hardware threads if they are available.

Leave a Comment