a. Threads within the same process share the same memory space
Mostly true (for most operating systems for normal usage). No strict requirement for it to be true (e.g. an OS could give each thread its own memory space, where some but not all is the same for different threads belonging to the same process - e.g. as a way to increase the amount of memory a process can use and/or to provide "thread specific storage" that other threads can't access).
Note that some operating systems, and some languages, and some environments, don't define "processes" and/or "threads" the same way as other operating systems/languages/environments. Examples include Erlang (where "process" is used more like "actor" in "actor model"); and Linux (where "process" and "thread" are emulated on top of a configurable "task" by specifying which things tasks do/don't share); and GPUs (which are mostly just CPUs with wider SIMD, where often "thread" is a synonym for "SIMD lane").
b. Process and its child process share the same memory space
Mostly false (for most operating systems for normal usage, but the note above applies). True for some cases (SASOS using managed languages to separate processes, small embedded systems that don't have an MMU, etc).
c. CPU execute only one thread at a time
Sort of true (if you ignore "CPU can execute zero threads", and GPUs).
d. Processes can communicate through pipes
Sort of true. In general there's no requirement for pipes to exist at all (and even if pipes seem like they exist they could just be emulated on top of something else, like message passing, so that it's possible to say processes communicate through something else without knowing it's not pipes).
发布评论
评论(1)
(对于大多数用于正常使用的操作系统)。没有严格要求它是真实的(例如,操作系统可以给出每个线程自己的内存空间,其中有些(但不是全部)对于属于同一过程的不同线程是相同的 - 例如,作为增加过程的内存量可以使用和/或提供其他线程无法访问的“线程特定存储”)。
请注意,某些操作系统,某些语言以及某些环境不会以与其他操作系统/语言/环境相同的方式定义“过程”和/或“线程”。示例包括Erlang(其中使用“过程”更像是“ Actor Model”中的“ Actor”); Linux(其中“过程”和“线程”是通过指定任务执行/不共享的可配置“任务”之上的);和gpus(通常仅与更宽的SIMD相关,其中“线程”通常是“ Simd Lane”的同义词)。
(大多数用于正常使用的操作系统,但上述注释都适用)。在某些情况下是正确的(SASO使用托管语言来分开过程,没有MMU的小型嵌入式系统等)。
(如果您忽略“ CPU可以执行零线程”和GPU)。
。通常,根本不需要管道存在(即使管道似乎存在,它们也可以在其他事物之上模仿,例如消息传递,以便可以说过程通过其他事物进行交流而不知道它不是管道)。
Mostly true (for most operating systems for normal usage). No strict requirement for it to be true (e.g. an OS could give each thread its own memory space, where some but not all is the same for different threads belonging to the same process - e.g. as a way to increase the amount of memory a process can use and/or to provide "thread specific storage" that other threads can't access).
Note that some operating systems, and some languages, and some environments, don't define "processes" and/or "threads" the same way as other operating systems/languages/environments. Examples include Erlang (where "process" is used more like "actor" in "actor model"); and Linux (where "process" and "thread" are emulated on top of a configurable "task" by specifying which things tasks do/don't share); and GPUs (which are mostly just CPUs with wider SIMD, where often "thread" is a synonym for "SIMD lane").
Mostly false (for most operating systems for normal usage, but the note above applies). True for some cases (SASOS using managed languages to separate processes, small embedded systems that don't have an MMU, etc).
Sort of true (if you ignore "CPU can execute zero threads", and GPUs).
Sort of true. In general there's no requirement for pipes to exist at all (and even if pipes seem like they exist they could just be emulated on top of something else, like message passing, so that it's possible to say processes communicate through something else without knowing it's not pipes).