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


cma_attr_set_priority

Changes the initial execution priority attribute of thread creation.

Syntax

cma_attr_set_priority(
                       attr,
                       priority);
 


Argument Data Type Access

attr opaque cma_t_attr read priority opaque cma_t_priority read


C Binding

#include 

void cma_attr_set_priority ( cma_t_attr *attr, cma_t_priority priority);

Arguments

attr
Handle of the attributes object modified.
priority
New value for the priority attribute. The priority attribute 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 sets the initial execution priority of threads that were created using the attributes object specified by the attr argument. The default value of the priority attribute is cma_c_prio_default_mid.

Note
You must set scheduling inheritance to cma_c_sched_use_default if you want to create threads with a scheduling policy or priority different from the creating thread.

An application should specify priority only to express the urgency of executing the thread relative to other threads. Priority should not be used to control mutual exclusion when accessing shared data. With a sufficient number of processors executing, all ready threads, regardless of priority, can be executing simultaneously.

Exceptions

cma_e_badparam
cma_e_existence
cma_e_use_error



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