summaryrefslogtreecommitdiffstats
path: root/posix-users
diff options
context:
space:
mode:
authorJoel Sherrill <joel@rtems.org>2017-10-11 19:56:20 -0500
committerJoel Sherrill <joel@rtems.org>2017-10-11 19:56:20 -0500
commitd36d685f9840afb44bc3da60ad5d0f71564c3782 (patch)
tree30b2e646d899969654acc796ab15eab028bf1de5 /posix-users
parentc-user: Update to reflect rtems_clock_get() being obsoleted. (diff)
downloadrtems-docs-d36d685f9840afb44bc3da60ad5d0f71564c3782.tar.bz2
posix-users/thread.rst: Add pthread_getconcurrency and pthread_setconcurrency
Closes #2680.
Diffstat (limited to 'posix-users')
-rw-r--r--posix-users/thread.rst69
1 files changed, 69 insertions, 0 deletions
diff --git a/posix-users/thread.rst b/posix-users/thread.rst
index e5f47c5..397cb9d 100644
--- a/posix-users/thread.rst
+++ b/posix-users/thread.rst
@@ -59,6 +59,10 @@ The services provided by the thread manager are:
- pthread_detach_ - Detach a Thread
+- pthread_getconcurrency_ - Get Thread Level of Concurrency
+
+- pthread_setconcurrency_ - Set Thread Level of Concurrency
+
- pthread_getattr_np_ - Get Thread Attributes
- pthread_join_ - Wait for Thread Termination
@@ -1061,6 +1065,71 @@ If any threads have previously joined with the specified thread, then they will
remain joined with that thread. Any subsequent calls to ``pthread_join`` on the
specified thread will fail.
+.. COMMENT: pthread_getconcurrency
+
+.. _pthread_getconcurrency:
+
+pthread_getconcurrency - Obtain Thread Concurrency
+--------------------------------------------------
+.. index:: pthread_getconcurrency
+.. index:: obtain thread concurrency
+
+**CALLING SEQUENCE:**
+
+.. code-block:: c
+
+ #include <pthread.h>
+ int pthread_getconcurrency(void);
+
+**STATUS CODES:**
+
+This method returns the current concurrency mapping value.
+
+**DESCRIPTION:**
+
+The ``pthread_getconcurrency`` method returns the number of user threads
+mapped onto kernel threads. For RTEMS, user and kernel threads are mapped
+1:1 and per the POSIX standard this method returns 1 initially and
+the value last set by ``pthread_setconcurrency`` otherwise.
+
+**NOTES:**
+
+NONE
+
+.. COMMENT: pthread_setconcurrency
+
+.. _pthread_setconcurrency:
+
+pthread_setconcurrency - Set Thread Concurrency
+-----------------------------------------------
+.. index:: pthread_setconcurrency
+.. index:: obtain thread concurrency
+
+**CALLING SEQUENCE:**
+
+.. code-block:: c
+
+ #include <pthread.h>
+ int pthread_setconcurrency(void);
+
+**STATUS CODES:**
+
+This method returns 0 on success.
+
+**DESCRIPTION:**
+
+The ``pthread_setconcurrency`` method requests the number of user threads
+mapped onto kernel threads. Per the POSIX standard, this is considered
+a request and may have no impact.
+
+For RTEMS, user and kernel threads are always mapped 1:1 and thus this
+method has no change on the mapping. However, ``pthread_getconcurrency``
+will return the value set.
+
+**NOTES:**
+
+NONE
+
.. COMMENT: pthread_getattr_np
.. _pthread_getattr_np: