Download Portable Embedded GUI Programming Manual

Transcript
Overview
C
H A P T E R
4
THE C/PEG EXECUTION MODEL
CHAPTER4
This section introduces the C/PEG execution model and describes how the
fundamental C/PEG objects work together to create a working interface.
This section focuses on establishing a high level view of C/PEG and the
internal components of a graphical presentation created with C/PEG, while
the following sections detail actual object descriptions, functions and
usage.
C/PEG supports two general execution models: single threaded and multithreaded. For the purposes of this discussion, we will be using the single
threaded model for an example. All of the concepts presented are valid
regardless of the execution model. It is only the flow of information and
processing that changes based on the execution model. A complete
discussion of multi-threading as it relates to C/PEG is included in a later
section “C/PEG Multi-Threading”.
4.1 Overview
The components of C/PEG that control the execution of the application are
PegTask, PegMessageQueue, PegPresentation and PegScreen. These
components work together to insure the interface operates in a well
defined, predictable and fault tolerant manner. These components are also
central to insuring the C/PEG application is portable to a variety of
embedded systems. In this section we will fully investigate PegTask and
PegPresentation, while PegMessageQueue and PegScreen are described
in the following sections.
PegTask provides the interface between C/PEG and the operating system.
When running in a single threaded environment, PegTask is simply the
entry point to the main program loop.
PegMessageQueue provides FIFO style message queue functionality for
sending information between C/PEG objects.
Swell Software, Inc.
The C/PEG Execution Model
27