`

Difference between Thread and Process

 
阅读更多

What is the difference between a process and a thread?

 

The major difference between threads and processes is:

  1. Threads share the address space of the process that created it; processes have their own address space.
  2. Threads have direct access to the data segment of its process; processes have their own copy of the data segment of the parent process.
  3. Threads can directly communicate with other threads of its process; processes must use interprocess communication to communicate with sibling processes.
  4. Threads have almost no overhead; processes have considerable overhead.
  5. New threads are easily created; new processes require duplication of the parent process.
  6. Threads can exercise considerable control over threads of the same process; processes can only exercise control over child processes.
  7. 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

分享到:
评论

相关推荐

    Mastering the C++17 .pdf

    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.

    java面试题英文版及其答案

    s built-in support for multithreading through the Thread class and the Runnable interface. By creating and starting multiple threads, a Java application can perform several operations simultaneously, ...

    DotNet面试题

    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 ...

    Packt.Mastering.Csharp.and.NET.Programming

    - **The Stack and the Heap**: Explains the difference between stack-allocated and heap-allocated memory and their respective uses. - **Garbage Collection**: Discusses how the .NET runtime ...

    微软内部资料-SQL性能优化2

    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 ...

    微软内部资料-SQL性能优化3

    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 ...

    CSharp 3.0 With the .NET Framework 3.5 Unleashed(english)

    - **A Quick Introduction to Reference Types and Value Types**: This section explains the fundamental difference between reference types (like objects and arrays) and value types (like integers and ...

    BobBuilder_app

    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 ...

    JProfiler Helper

    - Adjusting settings to balance between accuracy and performance impact. **Method Call Recording (A.1.3)** Method call recording allows for tracking the execution flow of methods within the ...

    重庆大学操作系统试卷

    - **题目**: The difference between a program and a process is that a program is an active entity while a process is a passive entity. - **解析**: 错误。实际上,程序是静态的指令集合,而进程是正在运行...

    acpi控制笔记本风扇转速

    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 ...

    Effective C#

    - **Importance:** Proper initialization ensures thread safety and avoids potential race conditions. - **Best Practice:** Initialize static fields in the constructor or inline. **Item 14: Minimize ...

    Java邮件开发Fundamentals of the JavaMail API

    * 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 ...

    Springer.The.Developer’s.Guide.to.Debugging.2008.pdf

    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 . ...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    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. ...

    Visual C++ 编程资源大全(英文源码 控件)

    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...

Global site tag (gtag.js) - Google Analytics