From the course: Complete Guide to Parallel and Concurrent Programming with Java

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Thread vs. process: Java demo

Thread vs. process: Java demo

- [Instructor] When you run a Java application, it executes within its own instance of the Java Virtual Machine, or JVM, and the operating system treats that instance of the JVM as its own independent process. So if you run multiple Java applications at the same time, they'll each execute in a separate JVM process with their own independent memory space. Now, before I demonstrate a Java process with several threads in action, let's first take a look at the number of processors that are available on this computer, which I'll be using for the demonstrations throughout this course. To do that, I'll press control, shift, escape to open the task manager, and then I'll select the Performance tab. At the bottom, I can see that this computer has 12 cores and 24 logical processors. It's quite a powerful computer. Those numbers mean this computer has 12 separate complete physical processing cores, and each of those cores support something called hyperthreading, which enables them to each run…

Contents