What is the difference between a process and a thread?
The major difference between threads and processes is:
- Threads share the address space of the process that created it; processes have their own address space.
- Threads have direct access to the data segment of its process; processes have their own copy of the data segment of the parent process.
- Threads can directly communicate with other threads of its process; processes must use interprocess communication to communicate with sibling processes.
- Threads have almost no overhead; processes have considerable overhead.
- New threads are easily created; new processes require duplication of the parent process.
- Threads can exercise considerable control over threads of the same process; processes can only exercise control over child processes.
- Changes to the main thread (cancellation, priority change, etc.) may affect the behavior of the other threads of the process; changes to the parent process does not affect child processes.
From: http://stackoverflow.com/questions/200469/what-is-the-difference-between-a-process-and-a-thread
相关推荐
Difference between a thread and an LWP Structures that describe the state of a kernel thread, an LWP, and a process How a mutex lock works Define a condition variable How a counting semaphore is ...
The difference between foreground and background threads 243 Understanding the .NET synchronization essentials 247 Locking and avoiding deadlocks 254 Thread safety and types of the .NET framework 261 ...
The C++ language has a long history, dating back to the 1980s. Recently it has undergone a renaissance, ...class and function templates, the difference between lvalue and rvalue references, and so on.
1. Describe the difference between a Thread and a Process? 2. What is a Windows Service and how does its lifecycle differ from a "standard" EXE? 3. What is the maximum amount of memory any ...
A process can leak resources such as process memory, pool memory, user and GDI objects, handles, threads, and so on. Memory Concepts (X86 Address Space) Per Process Address Space Every process ...
An isolation level determines the degree to which data is isolated for use by one process and guarded against interference from other processes. Prior to SQL Server 7.0, REPEATABLE READ and ...
Pages in a b+tree are usually implemented as a list or array of child pointers and so while finding and inserting a value is a O(log k) operation the process actually has to move children around in ...
condition is known to exist between AcpiWalkNamespace and the Load/Unload ASL operators and is still under investigation. Restructured the AML ParseLoop function, breaking it into several ...
* Connections between the JavaMail API and the JavaBeans Activation Framework Objectives By the end of this module you will be able to: * Send and read mail using the JavaMail API * Deal with ...
6.1.10 The Difference Between Algorithm and Implementation . . 70 6.2 Using Profiling Tools . . . . . . . . . . . . 72 6.2.1 Do Not Write Your Own Profiler . . . . . . . 72 6.2.2 How Profilers Work . ...
Correct use of header files can make a huge difference to the readability, size and performance of your code. The following rules will guide you through the various pitfalls of using header files. ...
05.zip Showing disabled combo text in black ComboBox的只读属性(5KB)<END><br>6,06.zip Combobox Color Picker 选择颜色的ComboBox(6KB)<END><br>7,07.zip Switch between drop down & drop list...