[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


cma_thread_set_sched

Changes the current scheduling policy and priority of a thread.

Syntax

cma_thread_set_sched(
                      thread,
                      policy,
                      priority);
 


Argument Data Type Access

thread opaque cma_t_thread read policy opaque cma_t_sched_ read policy priority opaque cma_t_priority read


C Binding

#include 

void cma_thread_set_sched ( cma_t_thread *thread, cma_t_sched_policy policy, cma_t_priority priority);

Arguments

thread
Handle of the thread whose scheduling policy is changed.
policy
New scheduling policy value of the thread specified in thread. Valid values are as follows:
   cma_c_sched_fifo
   cma_c_sched_rr
   cma_c_sched_throughput
   cma_c_sched_background

See Section 2.2.3.2 for a description of the scheduling policies.

priority
New priority value of the thread specified in thread. The priority value is dependent upon scheduling policy. Valid values are as follows:

Low               Mid               High

cma_c_prio_fifo_ cma_c_prio_fifo_ cma_c_prio_fifo_max min mid cma_c_prio_rr_ cma_c_prio_rr_ cma_c_prio_rr_max min mid cma_c_prio_ cma_c_prio_ cma_c_prio_through_max through_min through_mid cma_c_prio_back_ cma_c_prio_back_ cma_c_prio_back_max min mid


The default priority is cma_c_prio_default_mid. (This symbol maps to cma_c_prio_through_mid.)

Description

This routine changes the current scheduling policy and priority of a thread. You can call this routine to change both the priority and scheduling policy of a thread at the same time. To change only the priority, call the cma_thread_set_priority routine.

A thread can change its own scheduling policy and priority. Changing the scheduling policy or priority, or both, of a thread can cause it to start executing or to be preempted by another thread.

This routine is different from cma_attr_set_priority and cma_attr_ set_sched in that those routines set the priority and scheduling policy attributes that are used to establish the priority and scheduling policy of a new thread when it is created. This routine, however, changes the priority and scheduling policy of an existing thread.

Exceptions

cma_e_badparam
cma_e_existence
cma_e_unimp
cma_e_use_error
exc_e_nopriv



[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]