IceShard 1
A personal game engine project, with development focused on 2D/2.5D games.
Loading...
Searching...
No Matches
ice::TaskThreadPool Class Referenceabstract

#include <ice/task_thread_pool.hxx>

Public Member Functions

virtual ~TaskThreadPool () noexcept=default
virtual auto thread_count () const noexcept -> ice::ncount=0
virtual auto managed_thread_count () const noexcept -> ice::ncount=0
virtual auto estimated_task_count () const noexcept -> ice::ncount=0
virtual auto create_thread (ice::StringID name) noexcept -> ice::TaskThread &=0
 Creates an additonal thread with the given name (ID).
virtual auto find_thread (ice::StringID name) noexcept -> ice::TaskThread *=0
 Finds a thread created or attached with the given name.
virtual bool destroy_thread (ice::StringID name) noexcept=0
 Destroyes a previosuly created or attached thread with the given name.
virtual auto attach_thread (ice::StringID name, ice::UniquePtr< ice::TaskThread > thread) noexcept -> ice::TaskThread &=0
 Attaches a user created thread to the pool.
virtual auto detach_thread (ice::StringID name) noexcept -> ice::UniquePtr< ice::TaskThread >=0
 Detaches a previously user created thread from the pool.

Constructor & Destructor Documentation

◆ ~TaskThreadPool()

virtual ice::TaskThreadPool::~TaskThreadPool ( )
virtualdefaultnoexcept

Member Function Documentation

◆ attach_thread()

virtual auto ice::TaskThreadPool::attach_thread ( ice::StringID name,
ice::UniquePtr< ice::TaskThread > thread ) -> ice::TaskThread &
pure virtualnoexcept

Attaches a user created thread to the pool.

Note
This allows the user to create a thread with a separate queue, which can be used to also process tasks queued to the pool. In such a case the thread queue will receive a task poped from the poll queue.
Only tasks matching the 'accepting_flags' mask will be pushed to this thread.
The attached threads lifetime is managed by the pool after attaching.

◆ create_thread()

virtual auto ice::TaskThreadPool::create_thread ( ice::StringID name) -> ice::TaskThread &
pure virtualnoexcept

Creates an additonal thread with the given name (ID).

Note
This allows you to go over the initial thread count.

◆ destroy_thread()

virtual bool ice::TaskThreadPool::destroy_thread ( ice::StringID name)
pure virtualnoexcept

Destroyes a previosuly created or attached thread with the given name.

Note
Default created threads cannot be destroyed using this function.

◆ detach_thread()

virtual auto ice::TaskThreadPool::detach_thread ( ice::StringID name) -> ice::UniquePtr< ice::TaskThread >
pure virtualnoexcept

Detaches a previously user created thread from the pool.

Note
This function does not detach created named threads.

◆ estimated_task_count()

virtual auto ice::TaskThreadPool::estimated_task_count ( ) const -> ice::ncount
pure virtualnoexcept

◆ find_thread()

virtual auto ice::TaskThreadPool::find_thread ( ice::StringID name) -> ice::TaskThread *
pure virtualnoexcept

Finds a thread created or attached with the given name.

Note
Default created threads cannot be found using this function.

◆ managed_thread_count()

virtual auto ice::TaskThreadPool::managed_thread_count ( ) const -> ice::ncount
pure virtualnoexcept

◆ thread_count()

virtual auto ice::TaskThreadPool::thread_count ( ) const -> ice::ncount
pure virtualnoexcept

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