Struct Executor::ThreadState
Defined in File executor.hpp
Nested Relationships
This struct is a nested type of Class Executor.
Struct Documentation
-
struct
ripple::Executor
::
ThreadState
Defines the state for threads in the executor.
Public Types
-
using
SafeRunState
= std::atomic<RunState> Defines the type of the thread safe variable for the thread run state.
Public Functions
-
ThreadState
(uint32_t index, uint32_t cpu_threads, uint32_t gpu_threads, RunState state, ExecutionKind p) noexcept Constructor to create the state.
- Parameters
index
: The index of the thread.cpu_threads
: The total number of cpu threads.gpu_thread
: The totla number of gpu threads.state
: The initial run state for the thread.p
: The threads priority.
-
ThreadState
(ThreadState &&other) noexcept Move constructor to move the other state to this one.
- Parameters
other
: The other state to move.
-
ThreadState
(const ThreadState&) = delete Copy constructor deleted.
-
auto
processed_nodes
() const noexcept -> uint32_t Gets the number of nodes processed by the threads.
- Return
The number of threads processed by the thread.
-
auto
max_threads
(ExecutionKind kind) noexcept -> uint32_t Gets the max number of threads of the given execution kind.
- Return
The max number of threads for the given execution kind.
- Parameters
kind
: The kind of the execution.
-
auto
has_cpu_priority
() const noexcept -> bool Determines if the thread has cpu priority.
- Return
true if the thread has cpu priority.
-
auto
has_gpu_priority
() const noexcept -> bool Determines if the thread has gpu priority.
- Return
true if the thread has gpu priority.
-
auto
first_priority
() const noexcept -> ExecutionKind Gets the first priority type for the thread.
- Return
The first priority execution kind for the thread.
-
auto
second_priority
() const noexcept -> ExecutionKind Gets the second priority type for the thread.
- Return
The second priortity execution kind for the thread.
-
auto
is_shutdown
() const noexcept -> bool Determines if the thread is shutdown.
- Return
true if the thread is shutdown.
-
auto
is_paused
() const noexcept -> bool Determines if the thread is paused.
- Return
true if the thread is paused.
Public Members
-
SafeRunState
run_state
= RunState::paused Thread’s run state.
-
ExecutionKind
priority
= ExecutionKind::gpu Priority.
-
using