gpt4 book ai didi

c++ - 更改线程的并发级别有什么作用?

转载 作者:搜寻专家 更新时间:2023-10-31 01:18:49 25 4
gpt4 key购买 nike

我正在阅读 pthread_setconcurrency() 的手册页,但不知道“并发级别”是什么意思。只是为了模糊一个术语;改变并发级别会改变调度策略和进程优先级吗?它还有其他作用吗?

最佳答案

来自manual page on Linux :

NOTES
The default concurrency level is 0.

Concurrency levels are only meaningful for M:N threading implementations, where at any moment a subset of a process's set of user-level threads
may be bound to a smaller number of kernel-scheduling entities. Setting the concurrency level allows the application to give the system a hint as
to the number of kernel-scheduling entities that should be provided for efficient execution of the application.

Both LinuxThreads and NPTL are 1:1 threading implementations, so setting the concurrency level has no meaning. In other words, on Linux these
functions merely exist for compatibility with other systems, and they have no effect on the execution of a program.

关于c++ - 更改线程的并发级别有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6785422/

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