Shortcuts

Struct Executor::ThreadState

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

enum RunState

Defines the running state of the thread.

Values:

enumerator shutdown

Thread is shutdown.

enumerator paused

Thread is paused.

enumerator running

Thread is running.

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 inc_processed_nodes() noexcept -> void

Increments the number of processed nodes by one.

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.

auto is_running() const noexcept -> bool

Determines if the thread is running.

Return

true if the thread is running,

auto shutdown() noexcept -> void

Shuts down the thread.

auto pause() noexcept -> void

Sets the thread state to paused.

auto run() noexcept -> void

Sets the thread state to run.

Public Members

uint32_t id = 0

Thread’s id.

uint32_t max_cpu_threads = 0

Max cpu threads.

uint32_t max_gpu_threads = 0

Max gpu threads.

NodeCounter processed = 0

Nodes process.

SafeRunState run_state = RunState::paused

Thread’s run state.

ExecutionKind priority = ExecutionKind::gpu

Priority.

Docs

Access comprehensive developer documentation for Ripple

View Docs

Tutorials

Get tutorials to help with understand all features

View Tutorials

Examples

Find examples to help get started

View Examples