gpt4 book ai didi

c++ - C++ 应用程序可以创建多少个线程

转载 作者:IT老高 更新时间:2023-10-28 22:16:34 24 4
gpt4 key购买 nike

我想知道,一个 C++ 应用程序最多可以创建多少个线程。操作系统、硬件上限和其他因素是否会影响这些界限?

最佳答案

[C++11: 1.10/1]: [..] Under a hosted implementation, a C++ program can have more than one thread running concurrently. [..] Under a freestanding implementation, it is implementation-defined whether a program can have more than one thread of execution.

[C++11: 30.3/1]: 30.3 describes components that can be used to create and manage threads. [ Note: These threads are intended to map one-to-one with operating system threads. —end note ]

所以,基本上,这完全取决于实现和操作系统; C++ 不在乎!

它甚至没有在附件 B“实现数量”中列出建议!(实际上这似乎是一个遗漏)。

关于c++ - C++ 应用程序可以创建多少个线程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17345647/

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