How does the Sun JVM map Java threads to Windows threads? How does the Sun JVM map Java threads to Windows threads? windows windows

How does the Sun JVM map Java threads to Windows threads?


Don't have a document for you, but from the Threads column in the task-manager you can pretty reliably guess that it maps 1:1 to native threads (you need to enable the Threads column in the task manager first).

Oh, almost forgot, you can download the jdk src here and look yourself.


The mapping is platform-dependent, however I found an interesting comparison between platform threads for the vm (although probably a bit old). The bottom line is: you don't need to know. What you probably are more interested is to know about green threads (if you don't know already).

As for the naming question: Doesn't the constructor allow you to name a thread? Or do you mean name them and view their name on some windows thread browser?


How to name a Win32 thread

Unfortunately, this seems like it's impossible or at least very hard to do inside the Windows JVM.