Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

thr_create(3T)

thr_setconcurrency(3T)

NAME

thr_setconcurrency, thr_getconcurrency − get/set thread concurrency level

SYNOPSIS

#include <thread.h>

int thr_setconcurrency(int new_level);

int thr_getconcurrency(void );

MT-LEVEL

MT-Safe

DESCRIPTION

Unbound threads in a process (see thr_create(3T)) may or may not be required to be simultaneously active.  By default, the threads system ensures that a sufficient number of threads are active so that the process can continue to make progress.  While this conserves system resources, it may not produce the most effective level of concurrency.  thr_setconcurrency() permits the application to give the threads system a hint, specified by new_level, for the desired level of concurrency. The actual number of simultaneously active threads may be larger or smaller than this number. The value for the desired concurrency level may also be affected by creating threads with the THR_NEW_LWP flag set (see thr_create(3T)). 

If new_level is zero, the threads system will only ensure that a sufficient number of threads are active so that the process can continue to make progress. 

thr_getconcurrency() returns the current value for the desired concurrency level.  The actual number of simultaneously active threads may be larger or smaller than this number. 

RETURN VALUES

thr_setconcurrency() returns zero when successful.  A non-zero value indicates an error code. 

thr_getconcurrency() always returns the current value for the desired concurrency level. 

ERRORS

If any of the following conditions are detected, thr_setconcurrency() fails and returns the corresponding value:

EAGAIN the specified concurrency level would cause a system resource to be exceeded. 

EINVAL new_level is negative. 

SEE ALSO

thr_create(3T). 

NOTES

The Solaris threads set/get concurrency functionality described on this man page are not implemented in the POSIX threads interface. 

SunOS 5.5/SPARC  —  Last change: 22 Jan 1993

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026