gpt4 book ai didi

c - 零线程进程?

转载 作者:太空狗 更新时间:2023-10-29 15:20:33 24 4
gpt4 key购买 nike

一个进程中是否必须至少有一个线程?一个进程是否可能没有任何线程,或者这没有意义吗?

最佳答案

一个进程通常至少有一个线程。 Wikipedia有定义:

a thread of execution is the smallest unit of processing that can be scheduled by an operating system. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process.

The MSDN支持这一点:

A processor executes threads, not processes, so each application has at least one process, and a process always has at least one thread of execution, known as the primary thread.

虽然它继续说:

A process can have zero or more single-threaded apartments and zero or one multithreaded apartment.

这意味着如果单线程单元和多线程单元的数量都可以为零。然而,这个过程不会做太多:)

关于c - 零线程进程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7623493/

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