I have chat server application which we are going to deploy on 3 servers. chat application used lot of multithreading.
Basically i have to decide which os i should for those 3 servers. so i want to know how linux and windows handles java threads distinctively. what is the difference? who creates operating system threads? what memory are they assigning ?
If in future scope scalability and clustering which option is better?
The beauty of Java is that you don’t really care. They just work. But if you are really curious, modern JVMs delegate thread handling to the operating system. So it is more of an OS question rather than Java.
See above. Java has little to do here. It is about how threading is implemented in the host OS.
JVM asks OS to create them and provides a thin wrapper between Java
Threadobject and native threads.Each thread gets its own stack (seee
-XssJVM option). Also all threads share the same heap space.