This programming topic provides background information about the multiple user environment of Mac OS X. It also provides guidelines on how to write software to support this type of environment, including ways you may need to change your existing Mac OS X applications.
Mac OS X has always supported the use of a single machine by multiple users. Initially, this usage was exclusive; only one user at a time could log in to the console and use the machine. In version 10.3, Mac OS X introduced a feature called fast user switching that lets multiple login sessions run concurrently on the same machine. With this feature, one user at a time is active on the machine while the other user’s sessions continue to run in the background.
Prior to the introduction of fast user switching, developers could rely on the fact that only one user at a time was active on the system console. This meant that applications could make some assumptions about the availability of resources. Unfortunately, some of these assumptions may cause applications to fail in a fast user switching environment. If you are developing applications to run in Mac OS X, you should examine your designs and make sure they take multiple simultaneous users into account.
Note: Mac OS X has always supported multiple simultaneous users through secure shell (ssh
) connections. Each ssh
connection runs in its own login session. See “Root and Login Sessions” for more information about sessions and how they affect processes.
This programming topic contains the following articles:
“Root and Login Sessions” provides advanced material for daemon developers that describes the organization of the Mac OS X process space and how that organization impacts applications.
“Supporting Fast User Switching” provides general guidelines for application developers on how to make your application work in a fast user switching environment.
“User Switch Notifications” shows you how to handle the notifications that occur when the console user changes.
If you want to know more about the login/logout process, are writing a daemon or startup item, or want to know more about the daemons that run in the root session, see System Startup Programming Topics.
© 2003, 2005 Apple Computer, Inc. All Rights Reserved. (Last updated: 2005-07-07)