Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Processes
Chapter 1 - Introduction to Processes and Tasks / About Processes


Process Creation

When a user first opens your application, the Process Manager creates a partition for it. A partition is a contiguous block of memory that the Process Manager allocates for your application's use. The partition is divided into specific areas: application heap, A5 world, and stack. The application heap contains the application's 'CODE' segment 1, data structures, resources, and other code segments as needed. The A5 world contains the application's QuickDraw global variables, its application global variables, and its jump table, all of which are accessed through the A5 register. The application jump table contains one entry for every externally referenced routine in every code segment of your application. The application stack is used to store temporary variables. (See the chapter "Introduction to Memory Management" in Inside Macintosh: Memory for more complete details on these areas of your application's partition.)

When you create an application, you specify in its 'SIZE' resource how much memory you want the Process Manager to allocate for your application's partition. You specify two values: the preferred amount of memory to allocate and the minimum amount of memory to allocate. When a user opens your application from the Finder, the Process Manager first attempts to allocate a partition of the preferred size. If your application cannot be launched in the preferred amount of memory, the Finder might display a dialog box giving the user the option of opening the application using less than the preferred size. The Finder will not launch your application if the minimum amount of memory specified for your application is not available.

After the Process Manager creates a partition for your application, the Process Manager loads your code into memory and sets up the stack, heap, and A5 world (including the jump table) for your application. If the user selects one or more files to open or print, the Finder sets up information your application can use to determine which files to open or print.

The Process Manager assigns the application a process serial number, records its context, and returns control to the launching application (usually the Finder). The Process Manager typically transfers control to the new application after the launching application makes a subsequent call to WaitNextEvent or EventAvail.

The next section describes how your application can allow other applications to receive CPU time and how the Process Manager schedules CPU time among processes.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUN 1996