Processes and Threads

Processes
A process has a self-contained excution enviroment. A process generally has a complete, private set of basic run-time resource, in particular, each process has its own memory space.
Most implements of the java virtual machine run as a single process. A java application can create additional processes using a ProcessBuilder object.

Threads
Theads are sometime called lightweight processes. Both processes and threads provide an execution enviroment, but create a new thread require fewer resource than creating a new process.
Threads exist within a process - every process has at least one. Threads share the process's resource, including memory and open files. This makes for efficient, but potentially problematic, communication.
Multithreaded execution is an essential feture of the java platform.

你可能感兴趣的:(java,thread)