Snap Live SDK  8.2.1
Public Types | Public Member Functions | List of all members
KantarMedia::IThreadManager Class Referenceabstract

Base interface for thread priority/affinity management. More...

#include <ThreadManager.h>

Inheritance diagram for KantarMedia::IThreadManager:
KantarMedia::IACRLiveProcessor KantarMedia::ISnapLiveAudioEmbedder

Public Types

enum  eSchedulerPolicy { SCHED_POLICY_OTHER, SCHED_POLICY_FIFO, SCHED_POLICY_RR }
 scheduler policies available for thread priority management More...
 

Public Member Functions

virtual AUDIOSDK_Error SetThreadCPUAffinity (size_t affinity_mask)=0
 Set CPU affinity for all threads created by the watermarking library. More...
 
virtual AUDIOSDK_Error SetThreadPriority (eSchedulerPolicy policy, int priority)=0
 Set thread priority on all threads created by the SDK. More...
 

Detailed Description

Base interface for thread priority/affinity management.

Interface for managing threads affinity and priority

Member Enumeration Documentation

◆ eSchedulerPolicy

scheduler policies available for thread priority management

Enumerator
SCHED_POLICY_OTHER 

Default scheduling policy.

SCHED_POLICY_FIFO 

real-time scheduling policy with no timeslice

SCHED_POLICY_RR 

real-time scheduling policy with timeslice

Member Function Documentation

◆ SetThreadCPUAffinity()

virtual AUDIOSDK_Error KantarMedia::IThreadManager::SetThreadCPUAffinity ( size_t  affinity_mask)
pure virtual

Set CPU affinity for all threads created by the watermarking library.

This method allows specifying on which CPU(s) all the threads of the watermarking library are allowed to run

Parameters
[in]affinity_maskCPU affinity mask (CPU(s)on which threads are allowed to run)
Returns
AUDIOSDK_SUCCESS if operation succeeds.
AUDIOSDK_Error code if an error occurs.

◆ SetThreadPriority()

virtual AUDIOSDK_Error KantarMedia::IThreadManager::SetThreadPriority ( eSchedulerPolicy  policy,
int  priority 
)
pure virtual

Set thread priority on all threads created by the SDK.

This method allows setting the priority for all threads created by the SDK. All the thread used by the SDK will have the same priority. By default, all process threads are running under the SCHED_POLICY_OTHER policy with a priority value of 0.

Note 1:
For the SCHED_POLICY_FIFO and the SCHED_POLICY_RR policy, only superuser(root) is able to change the threads policy/priority.
For the SCHED_POLICY_OTHER policy, only superuser(root) is able to change for a higher priority
Note 2:
For the SCHED_POLICY_FIFO and the SCHED_POLICY_RR policy, priority range is [1(low), 99(high)]
For the SCHED_POLICY_OTHER policy, priority range is [-20(high), 19(low)]
Parameters
[in]policyscheduler policy to be used by SDK threads
[in]prioritypriority to be used for given policy
See also
eSchedulerPolicy
Returns
AUDIOSDK_SUCCESS if operation succeeds.
AUDIOSDK_Error code if an error occurs.

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