📄 pthread_attr_getscope.txt
字号:
pthread_attr_getscope SubroutinePurposeReturns the value of the contention-scope attribute of a thread attributesobject.LibraryThreads Library (libpthreads.a)Syntax#include <pthread.h>int pthread_attr_getscope (attr, scope)const pthread_attr_t *attr;int *scope;DescriptionThe pthread_attr_getscope subroutine returns the value of the contention-scopeattribute of the thread attributes object attr. This attribute specifiesthe contention scope of a thread created with this attributes object.It may have one of the following values:PTHREAD_SCOPE_PROCESS Specifes process (local) contention scope; thethread will be scheduled against other local contention scope threadsin the same process.PTHREAD_SCOPE_SYSTEM Specifies system (global) contention scope; thethread will be scheduled against all other threads. This is the defaultvalue.Note: The pthread.h header file must be the first included file ofeach source file using the threads library.Parametersattr Specifies the thread attributes object.scope Points to where the contention-scope attribute value will bestored.Return ValuesUpon successful completion, the value of the contention-scope attributeis returned via the scope parameter, and 0 is returned. Otherwise,an error code is returned.Error CodesThe pthread_attr_getscope subroutine is unsuccessful if the followingis true:EINVAL The attr parameter is not valid.ENOSYS The priority scheduling POSIX option is not implemented.Implementation SpecificsThis subroutine is part of the Base Operating System (BOS) Runtime.The implementation of this subroutine is dependent on the priorityscheduling POSIX option. The priority scheduling POSIX option is implementedin AIX, but in the current version all threads have system contentionscope; therefore, the pthread_attr_getscope subroutine always returnsa scope value of PTHREAD_SCOPE_SYSTEM.Related InformationThe pthread_attr_setscope subroutine, pthread_attr_init subroutine.Threads Scheduling.Threads Library Options and Threads Library Quick Reference.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -