我正在阅读pthread_setconcurrency()
的手册,但不知道“并发级别”是什么意思。这个术语太过模糊了;改变并发级别是否会改变调度策略和进程优先级?还有其他作用吗?
我正在阅读pthread_setconcurrency()
的手册,但不知道“并发级别”是什么意思。这个术语太过模糊了;改变并发级别是否会改变调度策略和进程优先级?还有其他作用吗?
来自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.