PFUNC
1.0
|
Class that represents thread specific meta-data. More...
#include <pfunc/thread.hpp>
Public Member Functions | |
thread_attr (const unsigned int &stack_size, const unsigned int &thread_id, const unsigned int &thread_affinity, const unsigned int &task_queue_number) | |
unsigned int | get_stack_size () const |
unsigned int | get_thread_id () const |
unsigned int | get_thread_affinity () const |
unsigned int | get_task_queue_number () const |
Private Attributes | |
const unsigned int | stack_size |
const unsigned int | thread_id |
const unsigned int | thread_affinity |
const unsigned int | task_queue_number |
void * | user_data |
Class that represents thread specific meta-data.
When a thread is created, it is passed along its attributes in the form of thread_attr structure. This structure contains important info such as ID, stacksize, queue out of which jobs need to be taken, etc.
pfunc::detail::thread_attr::thread_attr | ( | const unsigned int & | stack_size, |
const unsigned int & | thread_id, | ||
const unsigned int & | thread_affinity, | ||
const unsigned int & | task_queue_number | ||
) | [inline] |
Constructor
[in] | stack_size | Size of the stack for the thread which inherits this struct. Note that 0, 1 and 2 are reserved values for PFUNC_STACK_MAX, PFUNC_STACK_MIN and PFUNC_STACK_AVG. |
[in] | thread_id | ID of the thread. |
[in] | thread_affinity | Affinity of the thread to a processor. |
[in] | task_queue_number | Queue number from which to poll for jobs. |
unsigned int pfunc::detail::thread_attr::get_stack_size | ( | ) | const [inline] |
unsigned int pfunc::detail::thread_attr::get_task_queue_number | ( | ) | const [inline] |
unsigned int pfunc::detail::thread_attr::get_thread_affinity | ( | ) | const [inline] |
unsigned int pfunc::detail::thread_attr::get_thread_id | ( | ) | const [inline] |
const unsigned int pfunc::detail::thread_attr::stack_size [private] |
Size of the thread-specific stack
const unsigned int pfunc::detail::thread_attr::task_queue_number [private] |
An unsigned int from (0..num_queues)
const unsigned int pfunc::detail::thread_attr::thread_affinity [private] |
A number representing processor affinity
const unsigned int pfunc::detail::thread_attr::thread_id [private] |
An unsigned int from (0..num_threads)
void* pfunc::detail::thread_attr::user_data [private] |
Users can hang anything they want off of here