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


cma_attr_set_inherit_sched

Changes the inherit scheduling attribute of thread creation.

Syntax

cma_attr_set_inherit_sched(
                            attr,
                            setting);
 


Argument Data Type Access

attr opaque cma_t_attr read setting opaque cma_t_sched_ read inherit


C Binding

#include 

void cma_attr_set_inherit_sched ( cma_t_attr *attr, cma_t_sched_inherit setting);

Arguments

attr
Handle of the attributes object modified.
setting
New value for the inherit priority attribute. Valid values are as follows:
cma_c_sched_inherit   This is the default value. The created thread
                      inherits the current priority and scheduling
                      policy of the thread calling cma_thread_
                      create.

cma_c_sched_use_      The created thread starts execution with the
default               priority and scheduling policy stored in the
                      attributes object.


Description

This routine changes the inherit scheduling attribute of thread creation. The inherit scheduling attribute specifies whether threads created using this attributes object inherit the scheduling attributes of the creating thread, or use the scheduling attributes stored in the attributes object that is passed to cma_thread_create.

The initial thread in an application, which is not created by a call to cma_thread_create, has an initial priority of cma_c_prio_ through_mid and a scheduling policy of cma_c_sched_other. See the cma_attr_set_priority and cma_attr_set_sched routines for more information on valid priority values and valid scheduling policy values, respectively.

Inheriting scheduling attributes (instead of using the scheduling attributes stored in the attributes object) is useful when a thread is creating several helper threads-threads that are intended to work closely with the creating thread to cooperate in solving the same problem. For example, inherited scheduling attributes allow you to ensure that any helper threads created in a sort routine execute with the same priority as the calling thread.


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.

Exceptions

cma_e_badparam
cma_e_existence
cma_e_use_error



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