HELPLIB.HLB  —  POSIX Threads, PTHREAD routines, pthread_setconcurrency
    Changes the value of the concurrency level global variable for
    this process.

1  –  C Binding

    #include <pthread.h>

    int
    pthread_setconcurrency (
                int   level);

2  –  Arguments

 level

    New value for the concurrency level for this process.

3  –  Description

    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.

4  –  Return Values

    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.

5  –  Associated Routines

       pthread_getconcurrency()
Close Help