The Pedigree Project  0.1
Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | List of all members
RoundRobin Class Reference
+ Inheritance diagram for RoundRobin:
+ Collaboration diagram for RoundRobin:

Public Member Functions

 RoundRobin ()
 
virtual ~RoundRobin ()
 
virtual void addThread (Thread *pThread)
 
virtual void removeThread (Thread *pThread)
 
virtual ThreadgetNext (Thread *pCurrentThread)
 
virtual void threadStatusChanged (Thread *pThread)
 
- Public Member Functions inherited from SchedulingAlgorithm
virtual ~SchedulingAlgorithm ()
 

Private Types

typedef List< Thread * > ThreadList
 

Static Private Member Functions

static bool isReady (Thread *pThread)
 

Private Attributes

ThreadList m_pReadyQueues [MAX_PRIORITIES]
 
Spinlock m_Lock
 

Detailed Description

Definition at line 30 of file RoundRobin.h.

Constructor & Destructor Documentation

RoundRobin::RoundRobin ( )

Constructor.

Definition at line 29 of file RoundRobin.cc.

RoundRobin::~RoundRobin ( )
virtual

Destructor.

Definition at line 33 of file RoundRobin.cc.

Member Function Documentation

void RoundRobin::addThread ( Thread pThread)
virtual

Adds a new thread to be scheduled.

Implements SchedulingAlgorithm.

Definition at line 37 of file RoundRobin.cc.

Thread * RoundRobin::getNext ( Thread pCurrentThread)
virtual

Return the next thread that should be scheduled for the given Processor.

Parameters
pProcessorThe Processor for which the scheduling should take place - this is provided for heuristic purposes (core affinity etc).
Note
It is assumed that this function will set the Thread's TTL and other such values itself.

Implements SchedulingAlgorithm.

Definition at line 59 of file RoundRobin.cc.

References List< T, nodePoolSize >::popFront().

void RoundRobin::removeThread ( Thread pThread)
virtual

Removes a thread - this thread should no longer be scheduled.

Implements SchedulingAlgorithm.

Definition at line 41 of file RoundRobin.cc.

References List< T, nodePoolSize >::end(), and List< T, nodePoolSize >::erase().

void RoundRobin::threadStatusChanged ( Thread pThread)
virtual

Notifies us that the status of a thread has changed, and that we may need to take action.

Implements SchedulingAlgorithm.

Definition at line 81 of file RoundRobin.cc.

References assert, List< T, nodePoolSize >::begin(), List< T, nodePoolSize >::end(), Thread::getStatus(), and List< T, nodePoolSize >::pushBack().


The documentation for this class was generated from the following files: