#include <rte_os.h>
#include <rte_compat.h>
Go to the source code of this file.
Threading functions
Simple threads functionality supplied by EAL.
Definition in file rte_thread.h.
TLS key type, an opaque pointer.
Definition at line 26 of file rte_thread.h.
int rte_thread_set_affinity |
( |
rte_cpuset_t * |
cpusetp | ) |
|
Set core affinity of the current thread. Support both EAL and non-EAL thread and update TLS.
- Parameters
-
cpusetp | Pointer to CPU affinity to set. |
- Returns
- On success, return 0; otherwise return -1;
void rte_thread_get_affinity |
( |
rte_cpuset_t * |
cpusetp | ) |
|
Get core affinity of the current thread.
- Parameters
-
cpusetp | Pointer to CPU affinity of current thread. It presumes input is not NULL, otherwise it causes panic. |
__rte_experimental int rte_thread_tls_key_create |
( |
rte_tls_key * |
key, |
|
|
void(*)(void *) |
destructor |
|
) |
| |
Create a TLS data key visible to all threads in the process. the created key is later used to get/set a value. and optional destructor can be set to be called when a thread exits.
- Parameters
-
key | Pointer to store the allocated key. |
destructor | The function to be called when the thread exits. Ignored on Windows OS. |
- Returns
- On success, zero. On failure, a negative number.
__rte_experimental int rte_thread_tls_key_delete |
( |
rte_tls_key |
key | ) |
|
Delete a TLS data key visible to all threads in the process.
- Parameters
-
- Returns
- On success, zero. On failure, a negative number.
__rte_experimental int rte_thread_tls_value_set |
( |
rte_tls_key |
key, |
|
|
const void * |
value |
|
) |
| |
Set value bound to the TLS key on behalf of the calling thread.
- Parameters
-
- Returns
- On success, zero. On failure, a negative number.
__rte_experimental void* rte_thread_tls_value_get |
( |
rte_tls_key |
key | ) |
|
Get value bound to the TLS key on behalf of the calling thread.
- Parameters
-
- Returns
- On success, value data pointer (can also be NULL). On failure, NULL and an error number is set in rte_errno.