KeRTESy: A Real-Time Event-Driven Microkernel
By Biswajit Sain and Timothy A. Gonsalves
Dr. Dobb's Journal March 1997
CreateThread (threadname, priority, PREEMPTIVE(preemption-duration), <type>(type- dependent-value));
This system call creates an entry for the thread pointed to by threadname, in the thread table. Priority denotes the priority of the thread. If the thread is preemptive, then preemption-duration stores the number of ticks since the beginning of its execution after which the thread can be preempted. If it is non-preemptive, then preemption-duration contains -1. The last argument specifies the type of event that schedules the thread. The following are the permissible event types along with their values:
ALARM(duration) PERIODIC(period) EXPRESSION(expression) INTR(interrupt number)
duration and period are in number of ticks of system software timer. The ALARM type is a one-shot event, occurring upon the expiry of duration ticks. PERIOD occurs after every period ticks. EXPRESSION occurs when the specified expression evaluates to true. The INTERRUPT type of thread is established as an interrupt handler for the interrupt number specified.
Figure 1: Description of CreateThread.
Copyright © 1997, Dr. Dobb's Journal