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

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

问题描述

我在此处找到了问题的答案.但我不明白答案中的一些想法.例如,据说轻量级进程与其他进程共享其逻辑地址空间.这是什么意思?我可以理解 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 don't know, 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天全站免登陆