SOFA API  82c4ea2a
Open source framework for multi-physics simuation
sofa::simulation::DefaultTaskScheduler Class Reference

#include <DefaultTaskScheduler.h>

Inheritance diagram for sofa::simulation::DefaultTaskScheduler:

Public Member Functions

virtual void init (const unsigned int nbThread=0) final
 
void stop () final
 
WorkerThreadgetCurrent ()
 
unsigned int getThreadCount (void) const final
 
const chargetCurrentThreadName () override final
 
int getCurrentThreadType () override final
 
bool addTask (Task *task) override final
 
void workUntilDone (Task::Status *status) override final
 
Task::AllocatorgetTaskAllocator () override final
 
- Public Member Functions inherited from sofa::simulation::TaskScheduler
virtual ~TaskScheduler ()=default
 
virtual bool addTask (Task::Status &status, const std::function< void()> &task)
 

Static Public Member Functions

static const charname ()
 
static DefaultTaskSchedulercreate ()
 
- Static Public Member Functions inherited from sofa::simulation::TaskScheduler
static unsigned GetHardwareThreadsCount ()
 

Friends

class WorkerThread
 

Function details

◆ addTask()

bool sofa::simulation::DefaultTaskScheduler::addTask ( Task task)
finaloverridevirtual

◆ create()

DefaultTaskScheduler * sofa::simulation::DefaultTaskScheduler::create ( )
static

◆ getCurrent()

WorkerThread * sofa::simulation::DefaultTaskScheduler::getCurrent ( )

◆ getCurrentThreadName()

const char * sofa::simulation::DefaultTaskScheduler::getCurrentThreadName ( )
finaloverridevirtual

◆ getCurrentThreadType()

int sofa::simulation::DefaultTaskScheduler::getCurrentThreadType ( )
finaloverridevirtual

◆ getTaskAllocator()

Task::Allocator * sofa::simulation::DefaultTaskScheduler::getTaskAllocator ( )
finaloverridevirtual

◆ getThreadCount()

unsigned int sofa::simulation::DefaultTaskScheduler::getThreadCount ( void  ) const
inlinefinalvirtual

◆ init()

void sofa::simulation::DefaultTaskScheduler::init ( const unsigned int  nbThread = 0)
finalvirtual

Call stop() and start() if not already initialized

Parameters
nbThread

Implements sofa::simulation::TaskScheduler.

◆ name()

static const char* sofa::simulation::DefaultTaskScheduler::name ( )
inlinestatic

◆ stop()

void sofa::simulation::DefaultTaskScheduler::stop ( void  )
finalvirtual

Wait and destroy worker threads

Implements sofa::simulation::TaskScheduler.

◆ workUntilDone()

void sofa::simulation::DefaultTaskScheduler::workUntilDone ( Task::Status status)
finaloverridevirtual

Related details

◆ WorkerThread

friend class WorkerThread
friend