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_setschedprio.3p (3903B)


  1. '\" et
  2. .TH PTHREAD_SETSCHEDPRIO "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_setschedprio
  12. \(em dynamic thread scheduling parameters access
  13. (\fBREALTIME THREADS\fR)
  14. .SH SYNOPSIS
  15. .LP
  16. .nf
  17. #include <pthread.h>
  18. .P
  19. int pthread_setschedprio(pthread_t \fIthread\fP, int \fIprio\fP);
  20. .fi
  21. .SH DESCRIPTION
  22. The
  23. \fIpthread_setschedprio\fR()
  24. function shall set the scheduling priority for the thread whose thread
  25. ID is given by
  26. .IR thread
  27. to the value given by
  28. .IR prio .
  29. See
  30. .IR "Scheduling Policies"
  31. for a description on how this function call affects the ordering of the
  32. thread in the thread list for its new priority.
  33. .P
  34. If the
  35. \fIpthread_setschedprio\fR()
  36. function fails, the scheduling priority of the target thread shall not
  37. be changed.
  38. .SH "RETURN VALUE"
  39. If successful, the
  40. \fIpthread_setschedprio\fR()
  41. function shall return zero; otherwise, an error number shall be
  42. returned to indicate the error.
  43. .SH ERRORS
  44. The
  45. \fIpthread_setschedprio\fR()
  46. function may fail if:
  47. .TP
  48. .BR EINVAL
  49. The value of
  50. .IR prio
  51. is invalid for the scheduling policy of the specified thread.
  52. .TP
  53. .BR EPERM
  54. The caller does not have appropriate privileges to set the scheduling
  55. priority of the specified thread.
  56. .P
  57. The
  58. \fIpthread_setschedprio\fR()
  59. function shall not return an error code of
  60. .BR [EINTR] .
  61. .LP
  62. .IR "The following sections are informative."
  63. .SH EXAMPLES
  64. None.
  65. .SH "APPLICATION USAGE"
  66. None.
  67. .SH RATIONALE
  68. The
  69. \fIpthread_setschedprio\fR()
  70. function provides a way for an application to temporarily raise its
  71. priority and then lower it again, without having the undesired
  72. side-effect of yielding to other threads of the same priority. This is
  73. necessary if the application is to implement its own strategies for
  74. bounding priority inversion, such as priority inheritance or priority
  75. ceilings. This capability is especially important if the implementation
  76. does not support the Thread Priority Protection or Thread Priority
  77. Inheritance options, but even if those options are supported it is
  78. needed if the application is to bound priority inheritance for other
  79. resources, such as semaphores.
  80. .P
  81. The standard developers considered that while it might be preferable
  82. conceptually to solve this problem by modifying the specification of
  83. \fIpthread_setschedparam\fR(),
  84. it was too late to make such a change, as there may be implementations
  85. that would need to be changed. Therefore, this new function was
  86. introduced.
  87. .P
  88. If an implementation detects use of a thread ID after the end of its
  89. lifetime, it is recommended that the function should fail and report an
  90. .BR [ESRCH]
  91. error.
  92. .SH "FUTURE DIRECTIONS"
  93. None.
  94. .SH "SEE ALSO"
  95. .IR "Scheduling Policies",
  96. .IR "\fIpthread_getschedparam\fR\^(\|)"
  97. .P
  98. The Base Definitions volume of POSIX.1\(hy2017,
  99. .IR "\fB<pthread.h>\fP"
  100. .\"
  101. .SH COPYRIGHT
  102. Portions of this text are reprinted and reproduced in electronic form
  103. from IEEE Std 1003.1-2017, Standard for Information Technology
  104. -- Portable Operating System Interface (POSIX), The Open Group Base
  105. Specifications Issue 7, 2018 Edition,
  106. Copyright (C) 2018 by the Institute of
  107. Electrical and Electronics Engineers, Inc and The Open Group.
  108. In the event of any discrepancy between this version and the original IEEE and
  109. The Open Group Standard, the original IEEE and The Open Group Standard
  110. is the referee document. The original Standard can be obtained online at
  111. http://www.opengroup.org/unix/online.html .
  112. .PP
  113. Any typographical or formatting errors that appear
  114. in this page are most likely
  115. to have been introduced during the conversion of the source files to
  116. man page format. To report such errors, see
  117. https://www.kernel.org/doc/man-pages/reporting_bugs.html .