VMS Help
POSIX Threads, PTHREAD routines, pthread_setconcurrency
*Conan The Librarian (sorry for the slow response - running on an old VAX)
|
|
Changes the value of the concurrency level global variable for
this process.
#include <pthread.h>
int
pthread_setconcurrency (
int level);
level
New value for the concurrency level for this process.
This routine stores the value specified in the level argument in
the "concurrency level" global setting for the calling thread's
process. Because the Threads Library automatically manages the
concurrency of all threads in a multithreaded process, it ignores
this concurrency level value.
"Concurrency level" is a parameter used to coerce "simple" 2-
level schedulers into allowing application concurrency. The
Threads Library supplies the maximum concurrency at all times,
automatically. It has no need for coercion, and calls pthread_
setconcurrency() merely to determine the value returned by the
next call to pthread_getconcurrency().
The concurrency level value has no effect on the behavior of a
multithreaded program that uses the Threads Library. This routine
is provided for Single UNIX Specification, Version 2 source code
compatibility and has no other effect when called.
After calling this routine, subsequent calls to the pthread_
getconcurrency() routine return the same value, until another
call to pthread_setconcurrency() changes that value.
The initial concurrency level is zero (0), indicating that the
Threads Library manages the concurrency level. To indicate in a
portable manner that the implementation is to resume control of
concurrency level, call this routine with a level argument of
zero (0).
The concurrency level value can be obtained using the pthread_
getconcurrency() routine.
If an error condition occurs, this routine returns an integer
value indicating the type of error. Possible return values are as
follows:
Return Description
0 Successful completion.
[EAGAIN] The value specified by new_level would cause a system
resource to be exceeded.
[EINVAL] The value specified by new_level is negative.
pthread_getconcurrency()
[legal]
[privacy]
[GNU]
[policy]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.