StuBS
Assassin Class Reference

Handling for the "killer"-IPI, that is a message indicating that a thread should be terminated. More...

#include <thread/assassin.h>

Inheritance diagram for Assassin:
[legend]
Collaboration diagram for Assassin:
[legend]

Public Member Functions

void hire ()
 Configure the Assassin. More...
 
bool prologue ()
 Interrupt Prologue. More...
 
virtual void epilogue ()
 Interrupt Epilogue. More...
 
- Public Member Functions inherited from Gate
 Gate ()
 Constructor.
 
virtual ~Gate ()
 Destructor. More...
 
virtual bool prologue ()=0
 Device-specific interrupt handling routine that is executed immediately after the interrupt occurs (asynchronously). More...
 
virtual void epilogue ()
 Possibly delayed, synchronously executed Device-specific interrupt handling routine. More...
 

Detailed Description

Handling for the "killer"-IPI, that is a message indicating that a thread should be terminated.

Only required for MPStuBS.

If one thread wants to terminate another thread by calling Scheduler::kill(), and the thread to be killed is currently being executed on another CPU, this CPU needs to be notified that the active process is to be killed. MPStuBS relies on an inter-processor interrupt (IPI) for this purpose. The class Assassin shall handle the IPI by removing the active thread from scheduling and issue a reschedule iff the active thread has a set kill flag.

Member Function Documentation

◆ hire()

void Assassin::hire ( )

Configure the Assassin.

Setup the plugbox, such that the assassin will be executed once the corresponding IPI is issued.

Todo:
Implement Method (only in MPStuBS)

◆ prologue()

bool Assassin::prologue ( )
virtual

Interrupt Prologue.

There is nothing to do in the prologue except requesting an epilogue.

Returns
true to request an epilogue
Todo:
Implement Method (only in MPStuBS)

Implements Gate.

◆ epilogue()

void Assassin::epilogue ( )
virtual

Interrupt Epilogue.

The epilogue now should check the dying flag of the currently running thread and, if set, issue a rescheduling.

Todo:
Implement Method (only in MPStuBS)

Reimplemented from Gate.


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