next up previous contents
Next: Entities Up: The Main Task Previous: The Main Task   Contents

The Asynchronous Nature of Main Task

Main Task is a framework for running entities that provide services, and for controlling network devices. It is responsible for system initialization, reconfiguration, and communication of the reconfiguration events to the various entities, which in turn correspond with the functional tasks.

Main Task is also responsible for coordinating dependencies between entities and network devices. For example, it coordinates between a DSL PPP link and a dependent underlying ATM device.

Since OpenRG is a single-thread-single-process, operations should never perform blocking actions. Blocking actions are handled by an event dispatch loop. Main Task provides a callback mechanism to enable actions to be performed while other actions wait for a result.

Main Task's general behavior is as follows:

  1. Main Task runs a task for the first time by calling the task's open() function.
  2. During the task's life cycle, it may need to wait for an external event to occur. This delay may be the result of the task waiting for a timeout or a packet.
  3. The task will register a request for the desired event in Main Task's event dispatch loop, specifying a callback function, and return to its caller - usually Main Task.
  4. When the registered event occurs, the dispatch loop invokes the callback function to handle the event.


next up previous contents
Next: Entities Up: The Main Task Previous: The Main Task   Contents
Jungo Software Technologies