PFUNC  1.0
Public Member Functions | Private Attributes
pfunc::detail::thread_attr Struct Reference

Class that represents thread specific meta-data. More...

#include <pfunc/thread.hpp>

Inheritance diagram for pfunc::detail::thread_attr:
pfunc::detail::no_copy

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

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

Parameters:
[in]stack_sizeSize 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_idID of the thread.
[in]thread_affinityAffinity of the thread to a processor.
[in]task_queue_numberQueue number from which to poll for jobs.

Member Function Documentation

unsigned int pfunc::detail::thread_attr::get_stack_size ( ) const [inline]
Returns:
Size of the stack for this attribute.
unsigned int pfunc::detail::thread_attr::get_task_queue_number ( ) const [inline]
Returns:
Job queue number for this attribute.
unsigned int pfunc::detail::thread_attr::get_thread_affinity ( ) const [inline]
Returns:
Processor Affinity for this attribute.
unsigned int pfunc::detail::thread_attr::get_thread_id ( ) const [inline]
Returns:
Thread ID for this attribute.

Member Data Documentation

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)

Users can hang anything they want off of here


The documentation for this struct was generated from the following file: