Apple Lisa — 1.7 Interprocess Communication

Operating System Reference Manual Introduction system ln swapping data segments, calls are provided to give programs the ability to define which data segments must be in memory while a particular part of the program ls executing. You have control of how your program is divided up. For executable code segments, you use the segmentation commands of the Pascal compiler to break the program in pieces. In addition to residing in memory, data segments can be stored permanently on disk. They can be accessed with calls similar to File System calls. This allows you to use a data segment as a direct-access file—a file that is accessed as part of your memory space.

Calls are provided for making, killing, opening, and closing data segments. You can also change the size of a data segment and set lts access mode to read-only or read-write, ln addition, you can make a permanent disk copy of the contents of a data segment at any time. Other calls give you ability to force the contents of the data segment to be swapped into main memory so they can be accessed by your process. L6 Exceptions and Events An exception is an unexpected condition in the execution of a process (an lnterrupt> An event is a message from another process. An exception can be generated either by the system or by an executing program.

System exceptions are generated by various sorts of errors such as divide by zero, illegal instruction, and illegal address. System exception handlers are supplied that terminate the process. You can write your own exception handlers for any of these exceptions if you want to try to recover from the error. User exceptions can be declared and exception handlers can be written to process them. Your program can then signal this new exception. Events are messages sent from one process to another. They are sent through event channels. A process that expects a message from an event channel executes a call to wait for an event on that channel.

This will glve it the next message, if one exists, or block the process until a message arrives. If a process wants to know when an event arrives, but does not want to walt for it, it can use an event-call channel. This is set up by associating a user exception wlth the event channel when lt ls opened. The Operating System will then invoke the corresponding user exception handler whenever a message arrives in the event channel. 1.7 Interprocess Communication There are four methods for interprocess communication: shared files, pipes, event channels, and shared data segments. 1-5