logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

pthread_getconcurrency.3p (4531B)


  1. '\" et
  2. .TH PTHREAD_GETCONCURRENCY "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. pthread_getconcurrency,
  12. pthread_setconcurrency
  13. \(em get and set the level of concurrency
  14. .SH SYNOPSIS
  15. .LP
  16. .nf
  17. #include <pthread.h>
  18. .P
  19. int pthread_getconcurrency(void);
  20. int pthread_setconcurrency(int \fInew_level\fP);
  21. .fi
  22. .SH DESCRIPTION
  23. Unbound threads in a process may or may not be required to be
  24. simultaneously active. By default, the threads implementation ensures
  25. that a sufficient number of threads are active so that the process can
  26. continue to make progress. While this conserves system resources, it
  27. may not produce the most effective level of concurrency.
  28. .P
  29. The
  30. \fIpthread_setconcurrency\fR()
  31. function allows an application to inform the threads implementation of
  32. its desired concurrency level,
  33. .IR new_level .
  34. The actual level of concurrency provided by the implementation as a
  35. result of this function call is unspecified.
  36. .P
  37. If
  38. .IR new_level
  39. is zero, it causes the implementation to maintain the concurrency level
  40. at its discretion as if
  41. \fIpthread_setconcurrency\fR()
  42. had never been called.
  43. .P
  44. The
  45. \fIpthread_getconcurrency\fR()
  46. function shall return the value set by a previous call to the
  47. \fIpthread_setconcurrency\fR()
  48. function. If the
  49. \fIpthread_setconcurrency\fR()
  50. function was not previously called, this function shall return zero to
  51. indicate that the implementation is maintaining the concurrency level.
  52. .P
  53. A call to
  54. \fIpthread_setconcurrency\fR()
  55. shall inform the implementation of its desired concurrency level.
  56. The implementation shall use this as a hint, not a requirement.
  57. .P
  58. If an implementation does not support multiplexing of user threads on
  59. top of several kernel-scheduled entities, the
  60. \fIpthread_setconcurrency\fR()
  61. and
  62. \fIpthread_getconcurrency\fR()
  63. functions are provided for source code compatibility but they shall
  64. have no effect when called. To maintain the function semantics, the
  65. .IR new_level
  66. parameter is saved when
  67. \fIpthread_setconcurrency\fR()
  68. is called so that a subsequent call to
  69. \fIpthread_getconcurrency\fR()
  70. shall return the same value.
  71. .SH "RETURN VALUE"
  72. If successful, the
  73. \fIpthread_setconcurrency\fR()
  74. function shall return zero; otherwise, an error number shall be
  75. returned to indicate the error.
  76. .P
  77. The
  78. \fIpthread_getconcurrency\fR()
  79. function shall always return the concurrency level set by a previous
  80. call to
  81. \fIpthread_setconcurrency\fR().
  82. If the
  83. \fIpthread_setconcurrency\fR()
  84. function has never been called,
  85. \fIpthread_getconcurrency\fR()
  86. shall return zero.
  87. .SH ERRORS
  88. The
  89. \fIpthread_setconcurrency\fR()
  90. function shall fail if:
  91. .TP
  92. .BR EINVAL
  93. The value specified by
  94. .IR new_level
  95. is negative.
  96. .TP
  97. .BR EAGAIN
  98. The value specified by
  99. .IR new_level
  100. would cause a system resource to be exceeded.
  101. .P
  102. The
  103. \fIpthread_setconcurrency\fR()
  104. function shall not return an error code of
  105. .BR [EINTR] .
  106. .LP
  107. .IR "The following sections are informative."
  108. .SH EXAMPLES
  109. None.
  110. .SH "APPLICATION USAGE"
  111. Application developers should note that an implementation can always
  112. ignore any calls to
  113. \fIpthread_setconcurrency\fR()
  114. and return a constant for
  115. \fIpthread_getconcurrency\fR().
  116. For this reason, it is not recommended that portable applications
  117. use this function.
  118. .SH RATIONALE
  119. None.
  120. .SH "FUTURE DIRECTIONS"
  121. These functions may be removed in a future version.
  122. .SH "SEE ALSO"
  123. The Base Definitions volume of POSIX.1\(hy2017,
  124. .IR "\fB<pthread.h>\fP"
  125. .\"
  126. .SH COPYRIGHT
  127. Portions of this text are reprinted and reproduced in electronic form
  128. from IEEE Std 1003.1-2017, Standard for Information Technology
  129. -- Portable Operating System Interface (POSIX), The Open Group Base
  130. Specifications Issue 7, 2018 Edition,
  131. Copyright (C) 2018 by the Institute of
  132. Electrical and Electronics Engineers, Inc and The Open Group.
  133. In the event of any discrepancy between this version and the original IEEE and
  134. The Open Group Standard, the original IEEE and The Open Group Standard
  135. is the referee document. The original Standard can be obtained online at
  136. http://www.opengroup.org/unix/online.html .
  137. .PP
  138. Any typographical or formatting errors that appear
  139. in this page are most likely
  140. to have been introduced during the conversion of the source files to
  141. man page format. To report such errors, see
  142. https://www.kernel.org/doc/man-pages/reporting_bugs.html .