Important: The information in this document is obsolete and should not be used for new development.
Chapter 2 - Process Manager
This chapter describes the Process Manager, the part of the Macintosh Operating System that provides a cooperative multitasking environment. The Process Manager controls access to shared resources and manages the scheduling and execution of applications. The Finder uses the Process Manager to launch your application when the user opens either your application or a document created by your application. This chapter discusses how your application can control its execution and get information--for example, the number of free bytes in the application's heap--about itself or any other open application.Although earlier versions of system software provide process management, the Process Manager is available to your application only in system software version 7.0 and later. The Process Manager provides a cooperative multitasking environment, similar to the features provided by the MultiFinder option in earlier versions of system software. You can use the
Gestalt
function to find out if the Process Manager routines are available and to see which features of theLaunch
function are available.You should read the chapter "Introduction to Processes and Tasks" in this book for an overview of how the Process Manager schedules applications and loads them into memory. If your application needs to launch other applications, you need to read this chapter for information on the high-level function that lets your application launch other applications and the routines you can use to get information about open applications.
To use this chapter, you need to be familiar with how your application uses memory, as described in the chapter "Introduction to Memory Management" in Inside Macintosh: Memory. You should also be familiar with how your application receives events, as discussed in the chapter "Event Manager" in Inside Macintosh: Macintosh Toolbox Essentials.
This chapter provides a brief description of the Process Manager and then shows how you can
- control the execution of your application
- get information about your application
- launch other applications or desk accessories
- get information about applications launched by your application
- generate a list of all open applications and information about each one
- terminate the execution of your application
Chapter Contents
- About the Process Manager
- Using the Process Manager
- Getting Information About Other Processes
- Launching Other Applications
- Launching Desk Accessories
- Terminating an Application
- Process Manager Reference
- Constants
- Gestalt Selector and Response Bits
- Process-Identification Constants
- Launch Options
- Data Structures
- Process Serial Number
- Process Information Record
- Launch Parameter Block
- Application Parameters Record
- Routines
- Getting Process Information
- Launching Applications and Desk Accessories
- Terminating Processes
- Summary of the Process Manager
- Pascal Summary
- Constants
- Data Types
- Process Serial Number
- Process Information Record
- Application Parameters Record
- Launch Parameter Block
- Routines
- Getting Process Information
- Launching Applications and Desk Accessories
- Terminating a Process
- C Summary
- Constants
- Data Types
- Process Serial Number
- Process Information Record
- Application Parameters Record
- Launch Parameter Block
- Routines
- Getting Process Information
- Launching Applications and Desk Accessories
- Terminating a Process
- Assembly-Language Summary
- Data Structures
- Process Serial Number
- Process Information Record
- Application Parameters Record
- Launch Parameter Block
- Trap Macros
- Trap Macro Names
- Trap Macros Requiring Routine Selectors
- Result Codes