Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ thr_getconcurrency(3T) — SunOS 5.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

thr_create(3T)

attributes(5)

standards(5)

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);

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. 

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
MT-Level MT-Safe

SEE ALSO

thr_create(3T), attributes(5), standards(5)

NOTES

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

SunOS 5.6  —  Last change: 8 May 1997

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