gpt4 book ai didi

multithreading - 轻量级进程和线程有什么区别?

转载 作者:行者123 更新时间:2023-12-03 14:45:47 27 4
gpt4 key购买 nike

我找到了问题的答案 here .但我不明白答案中的一些想法。例如,据说轻量级进程与其他进程共享其逻辑地址空间。这是什么意思?我可以理解 2 个线程的相同情况:它们共享一个地址空间,因此它们都可以从 bss 段读取任何变量(例如)。但是我们有很多不同的流程,有不同的 bss 部分,我不知道如何共享所有这些。

最佳答案

来自 MSDN,Threads and Processes :

Processes exist in the operating system and correspond to what users see as programs or applications. A thread, on the other hand, exists within a process. For this reason, threads are sometimes referred to as light-weight processes. Each process consists of one or more threads.

关于multithreading - 轻量级进程和线程有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10484355/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com