Difference between revisions of "Process"

From Contiki
Jump to: navigation, search
(Protothreads)
Line 1: Line 1:
 
[[Contiki_tutorials | Back to Contiki Tutorials]]
 
[[Contiki_tutorials | Back to Contiki Tutorials]]
 +
 +
In Contiki, an application contains a process, also known as an event handler,
 +
 +
__TOC__
 +
 +
= Description =
  
 
The kernel process module (i.e., found in process.c) is the heart of the OS.  It contains a number of APIs for manipulating processes, events and scheduling.  There are two main data objects that exist here, the Process List and the FIFO Asynchronous Event Queue.
 
The kernel process module (i.e., found in process.c) is the heart of the OS.  It contains a number of APIs for manipulating processes, events and scheduling.  There are two main data objects that exist here, the Process List and the FIFO Asynchronous Event Queue.
Line 6: Line 12:
  
 
The FIFO Asynchronous Event Queue is implemented as a ring buffer whose length is fixed at compile time, through a configurable constant.  The asynchronous events in this queue can be either of the single receiver or broadcast type.  Note that synchronous events are never put into this queue as they are dispatched immediately.  The queue holds events that have not yet been dispatched.  They will be scheduled at a later time when the scheduler is invoked.
 
The FIFO Asynchronous Event Queue is implemented as a ring buffer whose length is fixed at compile time, through a configurable constant.  The asynchronous events in this queue can be either of the single receiver or broadcast type.  Note that synchronous events are never put into this queue as they are dispatched immediately.  The queue holds events that have not yet been dispatched.  They will be scheduled at a later time when the scheduler is invoked.
 
__TOC__
 
  
 
= Process Structure =
 
= Process Structure =
  
 
= Protothreads =
 
= Protothreads =

Revision as of 22:40, 10 February 2014

Back to Contiki Tutorials

In Contiki, an application contains a process, also known as an event handler,

Description

The kernel process module (i.e., found in process.c) is the heart of the OS. It contains a number of APIs for manipulating processes, events and scheduling. There are two main data objects that exist here, the Process List and the FIFO Asynchronous Event Queue.

The Process List is implemented as a singly linked list of process structures. This list only contains processes structures for processes that have been started in the system. These could either be processes that were started when the OS bootstrapped or were dynamically started during the run-time of the system. The length of the Process List can grow and shrink at run-time as new processes are started and/or older processes are stopped.

The FIFO Asynchronous Event Queue is implemented as a ring buffer whose length is fixed at compile time, through a configurable constant. The asynchronous events in this queue can be either of the single receiver or broadcast type. Note that synchronous events are never put into this queue as they are dispatched immediately. The queue holds events that have not yet been dispatched. They will be scheduled at a later time when the scheduler is invoked.

Process Structure

Protothreads