Skip to content

cvedia::rt::api::thread

Namespaces

Name
cvedia::rt::api:🧵:current

Classes

Name
class cvedia::rt::api:🧵:DetachedThreadScope
class cvedia::rt::api:🧵:ThreadRegistrationScope

Functions

Name
void sleep(int ms)
Sleep thread.
void dump()
NODISCARD expected< std::shared_ptr< internal::ThreadContext > > getThreadContext()
NODISCARD expected< int > getThreadVersion()
NODISCARD expected< std::shared_ptr< iface::Solution > > getActiveSolution()
NODISCARD expected< void > setActiveSolution(std::weak_ptr< iface::Solution > solution)
NODISCARD expected< std::shared_ptr< iface::Instance > > getActiveInstance()
Returns the Instance of an existing instance.
NODISCARD expected< void > setActiveInstance(std::weak_ptr< iface::Instance > instance)
NODISCARD expected< void > pinOnCpuCore()
NODISCARD expected< void > clearActiveInstance()
NODISCARD expected< void > unregisterThread()
NODISCARD expected< void > unregisterThread(std:🧵:id id)
void deleteAllThreads()
NODISCARD expected< void > registerThread(ThreadType t, int version =1, std::weak_ptr< iface::Instance > instance ={}, std::string const & location ="")
NODISCARD expected< void > registerThread(std::thread && th, ThreadType t, int version =1, std::string const & location ="")
NODISCARD expected< std::unique_ptr< ThreadRegistrationScope > > registerThreadScoped(ThreadType t, int version =1, std::string const & location ="")
NODISCARD expected< std::unique_ptr< ThreadRegistrationScope > > registerThreadScoped(ThreadType t, int version, std::weak_ptr< iface::Instance > instance, std::string const & location)
NODISCARD expected< std::unique_ptr< ThreadRegistrationScope > > registerThreadScopedOld(ThreadType t, int version =1, std::string const & location ="")
NODISCARD expected< std::unique_ptr< ThreadRegistrationScope > > registerThreadScopedOld(ThreadType t, int version, std::weak_ptr< iface::Instance > instance, std::string const & location)
NODISCARD bool isRegistered()
NODISCARD bool isRegistered(std:🧵:id id)
void setPerformanceMode(Affinity mode)
void setPerformanceModeOnThread(Affinity mode, std::thread & th)
NODISCARD expected< void > setThreadStorage(StorageType s)
NODISCARD expected< int > getVersion()
NODISCARD expected< void > setVersion(int version)
NODISCARD expected< StorageType > getThreadStorage()
NODISCARD expected< void > step(int steps =1)
NODISCARD int getThreadCount(std::weak_ptr< iface::Instance > instance, ThreadType type)
NODISCARD expected< float > getCounterValue(const std::string & name)
NODISCARD expected< void > setCounterValue(const std::string & name, uint32_t value)
NODISCARD expected< void > waitForThreads(std::weak_ptr< iface::Instance > instance, ThreadType type)
NODISCARD expected< void > waitForThread(std:🧵:id id)
expected< std::unique_lock< shared_mutex_class > > getWriteLock()
expected< std::shared_lock< shared_mutex_class > > getReadLock()

Attributes

Name
std::atomic< int > detachedThreadCount

Functions Documentation

function sleep

void sleep(
    int ms
)

Sleep thread.

Parameters:

  • number $ms Milliseconds to sleep

function dump

void dump()

function getThreadContext

NODISCARD expected< std::shared_ptr< internal::ThreadContext > > getThreadContext()

function getThreadVersion

NODISCARD expected< int > getThreadVersion()

function getActiveSolution

NODISCARD expected< std::shared_ptr< iface::Solution > > getActiveSolution()

function setActiveSolution

NODISCARD expected< void > setActiveSolution(
    std::weak_ptr< iface::Solution > solution
)

function getActiveInstance

NODISCARD expected< std::shared_ptr< iface::Instance > > getActiveInstance()

Returns the Instance of an existing instance.

Return: shared_ptr

function setActiveInstance

NODISCARD expected< void > setActiveInstance(
    std::weak_ptr< iface::Instance > instance
)

function pinOnCpuCore

NODISCARD expected< void > pinOnCpuCore()

function clearActiveInstance

NODISCARD expected< void > clearActiveInstance()

function unregisterThread

NODISCARD expected< void > unregisterThread()

function unregisterThread

NODISCARD expected< void > unregisterThread(
    std::thread::id id
)

function deleteAllThreads

void deleteAllThreads()

function registerThread

NODISCARD expected< void > registerThread(
    ThreadType t,
    int version =1,
    std::weak_ptr< iface::Instance > instance ={},
    std::string const & location =""
)

function registerThread

NODISCARD expected< void > registerThread(
    std::thread && th,
    ThreadType t,
    int version =1,
    std::string const & location =""
)

function registerThreadScoped

NODISCARD expected< std::unique_ptr< ThreadRegistrationScope > > registerThreadScoped(
    ThreadType t,
    int version =1,
    std::string const & location =""
)

function registerThreadScoped

NODISCARD expected< std::unique_ptr< ThreadRegistrationScope > > registerThreadScoped(
    ThreadType t,
    int version,
    std::weak_ptr< iface::Instance > instance,
    std::string const & location
)

function registerThreadScopedOld

NODISCARD expected< std::unique_ptr< ThreadRegistrationScope > > registerThreadScopedOld(
    ThreadType t,
    int version =1,
    std::string const & location =""
)

function registerThreadScopedOld

NODISCARD expected< std::unique_ptr< ThreadRegistrationScope > > registerThreadScopedOld(
    ThreadType t,
    int version,
    std::weak_ptr< iface::Instance > instance,
    std::string const & location
)

function isRegistered

NODISCARD bool isRegistered()

function isRegistered

NODISCARD bool isRegistered(
    std::thread::id id
)

function setPerformanceMode

void setPerformanceMode(
    Affinity mode
)

function setPerformanceModeOnThread

void setPerformanceModeOnThread(
    Affinity mode,
    std::thread & th
)

function setThreadStorage

NODISCARD expected< void > setThreadStorage(
    StorageType s
)

function getVersion

NODISCARD expected< int > getVersion()

function setVersion

NODISCARD expected< void > setVersion(
    int version
)

function getThreadStorage

NODISCARD expected< StorageType > getThreadStorage()

function step

NODISCARD expected< void > step(
    int steps =1
)

function getThreadCount

NODISCARD int getThreadCount(
    std::weak_ptr< iface::Instance > instance,
    ThreadType type
)

function getCounterValue

NODISCARD expected< float > getCounterValue(
    const std::string & name
)

function setCounterValue

NODISCARD expected< void > setCounterValue(
    const std::string & name,
    uint32_t value
)

function waitForThreads

NODISCARD expected< void > waitForThreads(
    std::weak_ptr< iface::Instance > instance,
    ThreadType type
)

function waitForThread

NODISCARD expected< void > waitForThread(
    std::thread::id id
)

function getWriteLock

expected< std::unique_lock< shared_mutex_class > > getWriteLock()

function getReadLock

expected< std::shared_lock< shared_mutex_class > > getReadLock()

Attributes Documentation

variable detachedThreadCount

std::atomic< int > detachedThreadCount = 0;