]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man3/pthread_getconcurrency.3
o Add pthread_yield.3 man page.
[FreeBSD/FreeBSD.git] / share / man / man3 / pthread_getconcurrency.3
1 .\" Copyright (c) 2003 Sergey Osokin <osa@FreeBSD.org.ru>
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .Dd April 11, 2003
27 .Dt PTHREAD_GETCONCURRENCY 3
28 .Os
29 .Sh NAME
30 .Nm pthread_getconcurrency ,
31 .Nm pthread_setconcurrency
32 .Nd get or set level of concurrency
33 .Sh LIBRARY
34 .Lb libc_r
35 .Lb libpthread
36 .Lb libthr
37 .Sh SYNOPSIS
38 .In pthread.h
39 .Ft int
40 .Fn pthread_getconcurrency void
41 .Ft int
42 .Fn pthread_setconcurrency "int new_level"
43 .Sh DESCRIPTION
44 The
45 .Fn pthread_getconcurrency
46 function allows an application to inform the threads implementation
47 of its desired concurrency level,
48 .Fa new_level .
49 The actual level of concurrency provided by the implementation
50 as a result of this function call is unspecified.
51 If
52 .Fa new_level
53 is zero, it causes the implementation to maintain the concurrency
54 level at its discretion as if
55 .Fn pthread_setconcurrency
56 was never called.
57 The
58 .Fn pthread_getconcurrency
59 function returns the value set by a previous call to the
60 .Fn pthread_setconcurrency
61 function.
62 If the
63 .Fn pthread_setconcurrency
64 function was not previously called, this function returns zero to
65 indicate that the implementation is maintaining the concurrency
66 level.
67 When an application calls
68 .Fn pthread_setconcurrency ,
69 it is informing the implementation of its desired concurrency
70 level.
71 The implementation uses this as a hint, not a requirement.
72 .Sh RETURN VALUES
73 If successful, the
74 .Fn pthread_setconcurrency
75 function returns zero.
76 Otherwise, an error number is returned
77 to indicate the error.
78 The
79 .Fn pthread_getconcurrency
80 function always returns the concurrency level set by a previous
81 call to
82 .Fn pthread_setconcurrency .
83 If the
84 .Fn pthread_setconcurrency
85 function has never been called,
86 .Fn pthread_getconcurrency
87 returns zero.
88 .Sh ERRORS
89 The
90 .Fn pthread_setconcurrency
91 function will fail if:
92 .Bl -tag -width Er
93 .It Bq Er EINVAL
94 The value specified by
95 .Fa new_level
96 is negative.
97 .It Bq Er EAGAIN
98 The value specified by
99 .Fa new_level
100 would cause a system resource to be exceeded.
101 .El
102 .Sh APPLICATION USAGE
103 Use of these functions changes the state of the underlying
104 concurrency upon which the application depends.
105 Library developers are advised to not use the
106 .Fn pthread_getconcurrency
107 and
108 .Fn pthread_setconcurrency
109 functions since their use may conflict with an application's
110 use of these functions.
111 .Sh STANDARDS
112 The
113 .Fn pthread_getconcurrency
114 and
115 .Fn pthread_setconcurrency
116 functions conform to
117 .St -susv2 .