22: Understanding Process Fundamentals

  1. Processes populate the telesphere with life
    1. A process is an autonomous executing object
    2. The Process class is abstract and has two abstract subclasses: Place and Agent. All processes are either places or agents.
    3. The Process class uses three mix-ins created specifically for processes:
      1. Named, which provides a telename (discussed later) for each process
      2. PackageProcess, which allows each process to use packages (described later) for shared information
      3. PermitProcess, which assigns permits (described later) to each process, controlling the process's behavior
    4. Processes can run simultaneously on a Telescript engine (preemptive multitasking)
  2. Identifying a Process
    1. Processes are differentiated by telenames.
      1. A telename is assigned by the engine whenever a process is constructed; the telename can't be falsified.
        1. The telename is kept in the name attribute of the process (through the Named mix-in)
      2. A telename has two attributes:
        1. The authority (described in detail later)
          1. Identifies the entity responsible for the construction and activities of this process.
          2. Is copied from the process responsible for construction of this process.
          3. Is an engine-computed octet string that distinguishes this authority from all other authorities no matter when or where created.
          4. A telename must have an authority.
        2. The identity
          1. Identifies the process as a unique entity within the authority.
          2. Is an engine-computed octet string that distinguishes this process from all others of the same authority no matter when or where they were created.
          3. Identity is optional in a telename.
    2. Telenames are used when one process wants to specify another process, but doesn't have a reference to the second process--for example, when an agent wants to meet with another agent.
      1. A telename that has an authority but no identity (called an advanced telename) identifies all processes of that authority. It is a very general identity, especially in a place where there are many processes of the same authority
      2. A telename that has both an authority and an identity is called an assigned telename. It identifies a single process.
      3. Two processes that share the same authority are peers. Their telenames, which share the same authority, are also peers.
    3. Using global variables
      1. A global variable is a Telescript keyword that a requester may use in place of an object identifier in an operation request. The Telescript engine replaces the selector with a reference to the appropriate object at the time the operation is requested.
      2. Global variables are useful for agents and places that need references to currrently meaningful objects.
      3. Global variables provided by Telescript are:
        1. self or *: specifies the operation's responder
        2. client: specifies the operation's requester
        3. process: specifies the current process (the process currently being executed--see the chapter on multitasking)
        4. here: specifies the current process's place of occupancy
        5. place: specifies the current process if it's a place; otherwise specifies the current process's place of occupancy.
        6. owner: specifies the current owner (ownership is discussed in the ownership chapter)
        7. sponsor: specifies the current sponsor of execution (sponsorship is discussed in the multitasking chapter)
  3. Permits (a sketchy overview)
    1. Every process's activities are governed by permits.
      1. Permits restrict a process's activities so they aren't harmful or don't consume too many resources.
      2. Permits limit a process's age, size, and ability to perform different actions, among other things.
    2. A process is issued different permits that restrict its behavior. Some of these permits (and the capabilities they restrict) may change if the process changes location.
      1. The process receives permits on initialization.
      2. Permits are stored in the attributes of the PermitProcess mix-in used to define the Process class.
      3. The process, if it moves from place to place (that is, it's an agent), may receive new permits when it arrives at a new location.
      4. A process may also receive temporary permits when it executes a specially designated block of code.
    3. The process's behavior is governed by the combination of all of its permits, restricting the process to only capabilities allowed by all the permits.
  4. The life of a process
    1. A process goes through three stages of life.
      1. Construction by the engine when another process instantiates a process class
        1. Construction is performed when the engine calls "initialize" on the process.
      2. Living, which is the execution--immediately after construction--of the process's live method
        1. Every process must have a live operation.
        2. The live operation can only be called by the engine.
      3. Termination by the engine
        1. A process is terminated on construction if an exception is thrown.
        2. A process is terminated while executing the live method if an exception is thrown. (Note that the process may have permission (via permit) to be restarted. If so, the engine restarts the live operation using the thrown exception as the argument.)
        3. A process is terminated if its permit runs out.
        4. A process is terminated if its live method ends.
    2. Process persistence
      1. The state of a process is periodically backed up by the engine.
      2. If the engine fails, the process is unavailable until the engine resumes operation.
      3. The process is restored to its last saved state when the engine resumes, and the process resumes execution.
    3. Process interaction
      1. One process can work directly with another process by requesting operations on the second process.
        1. Operation arguments and results allow processes to trade objects back and forth. They can do so by reference, by copy, or by changing ownership.
        2. Processes can only interact if one process has a reference to the other process, which is not always the case.
        3. When one process (the requester) calls an operation on a second process (the responder), the operation may sponsored by the second process.
          1. A sponsored operation executes under the authority (discussed later) of the responder.
          2. If the operation is not declared a sponsored operation, it executes under the authority of the requester.
        4. Operation boundaries
          1. An operation called on another process is a foreign operation to the requester.
          2. An operation called by a process on itself or a nonprocess object is a domestic operation.
      2. Processes can also interact using other Telescript mechanisms: packages, events, and resources (all described in later chapters of their own).
        1. These mechanisms provide multicast communication so one process can communicate with many other processes simultaneously.

TS Ref - 26 JUN 1996

Generated by the sweat of Mike Boom's brow.