next up previous top
Next: IDLType
Up: Property
Previous: BuildOption

EntryPoint

Description

The EntryPoint property is used to further specify a Computation, Module, Process, or SchedProcess component. It is typically used to specify an instantiation of such a component, but it can also be used to specify a definition.

The value of the EntryPoint property is the name of the entrypoint in the implementation that is to receive control at run-time after initialization of the process containing the source code is completed. For example, in UniCon the system designer must implement a Process component as a function or a collection of functions in some programming language (e.g., the C language). UniCon generates the main program that initializes the Process component at run-time and then transfers control to the function specified in the EntryPoint property.

For Computation and Module components, UniCon ignores the EntryPoint property for now. This is because Unix processes generated from Module or Computation components need no additional run-time initialization, and therefore UniCon does not need to produce a main program for them. For these components, the entrypoint is assumed to be "main" for now, since UniCon only handles implementations in the C language to date.

For Process and SchedProcess components, the value of the EntryPoint property has a different set of semantics for client processes and server processes. In UniCon, a process is a client process if it makes remote routine calls and does not export remote routine definitions (services) to be called. A process is a server process if it exports remote routine definitions. Processes not involved in remote procedure calls have the same semantics as client processes.

For client processes, the value of the EntryPoint property must name the function that will get control once the main program generated by the UniCon compiler to initialize the Unix process at run-time finishes its initialization. The name supplied as the entrypoint can be "main," but the UniCon compiler will rename this to some generated name when building the code for the process. This is because the main program it generates to do the initialization must be named "main."

For server processes, the value of the EntryPoint property must name a "worker function" that performs application-specific work not directly related to the task of servicing requests from clients. For server processes, the UniCon compiler generates a "main" program for initialization, and it also generates a function that polls for messages from clients and calls the appropriate functions that provide requested services. This polling function gets control from the "main" program after initialization and does not return. The function named by the value of the EntryPoint property will be invoked to perform work in parallel with the polling function.

In the Mach and Real-Time Mach environments, the worker function is turned into a light-weight process that runs in parallel with the light-weight process that polls for service requests. In these environments, the function must be designed so that it never returns. If it does, then the light-weight process will never be rescheduled to run. In environments that support RPCGen such as SunOS, the function is called periodically from the heavyweight process that polls for the service requests. The worker function is called after each service request, and once every 10 milliseconds when no service requests are made. In this environment, the worker function must be designed to return. If it does not, then the polling function will never regain control and the server will appear to "hang."

Property Lists

The EntryPoint property can legally be specified in the property list in the following
UniCon language elements:

Value Syntax

The syntax of the value part of the EntryPoint property is a single "string" or
<identifier>, enclosed in parentheses. The case of the letters can be upper, lower, or mixed.

Required Rule

Optional

The default value for the EntryPoint property for Process and SchedProcess client components is "main." Client also refers to a component that does not make RPCs.

There is no default value for the EntryPoint property for Process and SchedProcess server components.

There is no default value for the EntryPoint property for Module and Computation components.

Merge Rule

REPLACE

Subsequent specifications of the EntryPoint property in a single property list replace earlier specifications (i.e., the last specification is the one that the UniCon compiler uses).

Semantic Checks

All source files implementing the Process or SchedProcess component are scanned for a C language function definition of the name specified in the EntryPoint property. Case is significant in this check. If the name is not found, an error is reported to the system designer. In the case of a client Process or SchedProcess where no EntryPoint property is specified, the source is scanned for the name "main."

If an EntryPoint property is specified, but none of the files implementing the component are source files, then the check is abandoned. In this case, the UniCon compiler will attempt to build the executable for the process, but no guarantees are made about the viability of such an executable at run-time.

Example

The following is an example of a specification of an EntryPoint property. It is embedded in the instantiation of a client SchedProcess component in some real-time system:

  USES Client INTERFACE RT_Client
    PRIORITY (10)
    ENTRYPOINT (client)
  END Client

next up previous top
Next: IDLType
Up: Property
Previous: BuildOption

Comments? Mail the current maintainer of this page.

Author: Gregory Zelesnik

Last Modified: May 12, 1996