NeKernel dev
Loading...
Searching...
No Matches
Kernel::UserProcessScheduler Class Referencefinal

USER_PROCESS scheduler class. The main class which you call to schedule user processes. More...

#include <UserProcessScheduler.h>

Inheritance diagram for Kernel::UserProcessScheduler:
Kernel::ISchedulable

Public Member Functions

 UserProcessScheduler ()=default
 ~UserProcessScheduler () override=default
 operator bool ()
 this checks if any process is on the team.
bool operator! ()
 this checks if no process is on the team.
UserProcessTeamTheCurrentTeam ()
 Gets the current scheduled team.
BOOL SwitchTeam (UserProcessTeam &team)
 Switches the current team.
ProcessID Spawn (const Char *name, VoidPtr code, VoidPtr image)
 Add process to team.
Void Remove (ProcessID process_id)
 Remove process from the team.
Bool IsUser () override
 Is it a user scheduler?
Bool IsKernel () override
 Is it a kernel scheduler?
Bool HasMP () override
 Is it a SMP scheduler?
USER_PROCESS_REFTheCurrentProcess ()
 Gets current running process.
SizeT Run () noexcept
 Run User scheduler object.
STATIC UserProcessSchedulerThe ()
 Retrieves the singleton of the process scheduler.
Public Member Functions inherited from Kernel::ISchedulable
 ISchedulable ()=default
virtual ~ISchedulable ()=default
ISchedulableoperator= (const ISchedulable &)=default
 ISchedulable (const ISchedulable &)=default

Private Attributes

UserProcessTeam mTeam {}

Friends

class UserProcessHelper

Detailed Description

USER_PROCESS scheduler class. The main class which you call to schedule user processes.

Constructor & Destructor Documentation

◆ UserProcessScheduler()

Kernel::UserProcessScheduler::UserProcessScheduler ( )
explicitdefault

◆ ~UserProcessScheduler()

Kernel::UserProcessScheduler::~UserProcessScheduler ( )
overridedefault

Member Function Documentation

◆ HasMP()

Bool Kernel::UserProcessScheduler::HasMP ( )
overridevirtual

Is it a SMP scheduler?

Reimplemented from Kernel::ISchedulable.

◆ IsKernel()

Bool Kernel::UserProcessScheduler::IsKernel ( )
overridevirtual

Is it a kernel scheduler?

Reimplemented from Kernel::ISchedulable.

◆ IsUser()

Bool Kernel::UserProcessScheduler::IsUser ( )
overridevirtual

Is it a user scheduler?

Reimplemented from Kernel::ISchedulable.

◆ operator bool()

Kernel::UserProcessScheduler::operator bool ( )

this checks if any process is on the team.

◆ operator!()

Bool Kernel::UserProcessScheduler::operator! ( )

this checks if no process is on the team.

◆ Remove()

Void Kernel::UserProcessScheduler::Remove ( ProcessID process_id)

Remove process from the team.

Parameters
process_idprocess slot inside team.
Return values
trueprocess was removed.
falseprocess doesn't exist in team.

◆ Run()

SizeT Kernel::UserProcessScheduler::Run ( )
noexcept

Run User scheduler object.

Returns
USER_PROCESS count executed within a team.

we store this guy to tell the scheduler how many things we have scheduled.

Check if the process needs to be run.

Increase the usage time of the process.

◆ Spawn()

ProcessID Kernel::UserProcessScheduler::Spawn ( const Char * name,
VoidPtr code,
VoidPtr image )

Add process to team.

Parameters
processthe process Ref class.
Returns
the process index inside the team.
Todo
File Tree allocation and dispose methods (amlal)

◆ SwitchTeam()

BOOL Kernel::UserProcessScheduler::SwitchTeam ( UserProcessTeam & team)

Switches the current team.

Parameters
teamthe new team to switch to.
Return values
trueteam was switched.
falseteam was not switched.

◆ The()

UserProcessScheduler & Kernel::UserProcessScheduler::The ( )

Retrieves the singleton of the process scheduler.

◆ TheCurrentProcess()

Ref< USER_PROCESS > & Kernel::UserProcessScheduler::TheCurrentProcess ( )

Gets current running process.

Returns

◆ TheCurrentTeam()

UserProcessTeam & Kernel::UserProcessScheduler::TheCurrentTeam ( )

Gets the current scheduled team.

Returns

◆ UserProcessHelper

friend class UserProcessHelper
friend

Member Data Documentation

◆ mTeam

UserProcessTeam Kernel::UserProcessScheduler::mTeam {}
private

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