轻量级进程和线程之间有什么区别? [英] What the difference between lightweight process and thread?

查看:359
本文介绍了轻量级进程和线程之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I found an answer to the question here. But I don't understand some ideas in the answer. For instance, lightweight process is said to share its logical address space with other processes. What does it mean? I can understand the same situation with 2 threads: both of them share one address space, so both of them can read any variables from bss segment (for example). But we've got a lot of different processes with different bss sections and I dunno how to share all of them.

推荐答案

从MSDN,线程和进程:

进程存在于操作系统中,并与用户对应 视为程序或应用程序.另一方面,存在线程 在一个过程中. 因此,有时会引用线程 作为轻量级的过程.每个过程都包含一个或多个 线程.

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.

这篇关于轻量级进程和线程之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆