The Pedigree Project 0.1
Public Member Functions | Private Member Functions | 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 Thread * getNext (Thread *pCurrentThread)
 
virtual bool hasReady ()
 
virtual void threadStatusChanged (Thread *pThread)
 
- Public Member Functions inherited from SchedulingAlgorithm
virtual ~SchedulingAlgorithm ()
 

Private Member Functions

void enqueue (Thread *pThread)
 
void unlink (Thread *pThread)
 

Static Private Member Functions

static bool isReady (Thread *pThread)
 

Private Attributes

Thread * m_pReadyQueueHeads [MAX_PRIORITIES]
 
Thread * m_pReadyQueueTails [MAX_PRIORITIES]
 
Spinlock m_Lock
 

Detailed Description

Definition at line 29 of file RoundRobin.h.

Constructor & Destructor Documentation

◆ RoundRobin()

RoundRobin::RoundRobin ( )

Constructor.

Definition at line 31 of file RoundRobin.cc.

◆ ~RoundRobin()

RoundRobin::~RoundRobin ( )
virtual

Destructor.

Definition at line 41 of file RoundRobin.cc.

Member Function Documentation

◆ addThread()

void RoundRobin::addThread ( Thread *  pThread)
virtual

Adds a new thread to be scheduled.

Implements SchedulingAlgorithm.

Definition at line 50 of file RoundRobin.cc.

◆ enqueue()

void RoundRobin::enqueue ( Thread *  pThread)
private

Definition at line 57 of file RoundRobin.cc.

◆ getNext()

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 110 of file RoundRobin.cc.

◆ hasReady()

bool RoundRobin::hasReady ( )
virtual

Whether the ready queue contains a runnable peer.

Implements SchedulingAlgorithm.

Definition at line 150 of file RoundRobin.cc.

◆ isReady()

bool RoundRobin::isReady ( Thread *  pThread)
staticprivate

Definition at line 176 of file RoundRobin.cc.

◆ removeThread()

void RoundRobin::removeThread ( Thread *  pThread)
virtual

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

Implements SchedulingAlgorithm.

Definition at line 52 of file RoundRobin.cc.

◆ threadStatusChanged()

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 160 of file RoundRobin.cc.

◆ unlink()

void RoundRobin::unlink ( Thread *  pThread)
private

Definition at line 80 of file RoundRobin.cc.

Member Data Documentation

◆ m_Lock

Spinlock RoundRobin::m_Lock
private

Definition at line 64 of file RoundRobin.h.

◆ m_pReadyQueueHeads

Thread* RoundRobin::m_pReadyQueueHeads[MAX_PRIORITIES]
private

Definition at line 58 of file RoundRobin.h.

◆ m_pReadyQueueTails

Thread* RoundRobin::m_pReadyQueueTails[MAX_PRIORITIES]
private

Definition at line 59 of file RoundRobin.h.


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