what is a process and what is a thread
System to do one thing, run a task, all the running tasks are usually a program;
Each running program is a process that can be seen visually in the task Manager.
When a program is running, the interior may contain multiple sequential execution flows, each of which is a thread.
about the characteristics of the process
Independence: A process is an independent entity in a system that can have its own independent resources, each with its own private address space. The content cannot be accessed without the process itself running.
Dynamic: The difference between process and program is that the program is static and the process is dynamic. A program is just a static set of instructions, and a process is a collection of instructions running in the system. Have the concept of time, such as the life cycle;
Concurrency: Between processes, alternately executed.
Thread, a sequential execution stream;
It is part of the process, and a process can have multiple threads.
about the characteristics of the thread, or its advantages
1, the process can not share memory, the single thread shared memory is very easy
2. The system creation process needs to reallocate system resources for the process, but the cost of creating threads is very small. Therefore, multi-threading implementation of multitasking is more efficient than concurrent implementation of multiple processes
3, the Java language built-in multi-threaded feature support, rather than simply as the underlying operating system of the scheduling method
Summary:
A program runs at least one process, a process containing at least one thread, and the thread is part of the process.
Line threads relative for the process, it is very powerful, to achieve the sharing of resources, the loss of resources to reduce the artificial manual control program operation.