macos:Multiple-user-issues
出自UXGuide.net
请帮助我们修订和更新本文的中文部分
本文的中文部分虽然取自官方最新中文版本,但与英文原版相比已落后了一年多,可能无法反映英文版本中最近的修改,且文中笔误、前后译法矛盾、未翻译完全的片断较多,请您帮助一起修订完善。详情参见中文版修订完善计划。
多用户
Multiple User Issues
Remember that Mac OS X is a multiple-user system. Not only does the system support multiple user accounts, it supports multiple users sharing the same computer simultaneously. This feature employs a technique known as fast user switching, in which users trade use of the computer without logging out. With multiple users accessing the computer, conflicts can arise if applications are not careful about how they use shared resources. Shared memory, cache files, semaphores, and named pipes must be carefully labeled to prevent corruption by users running the same application in different sessions. Applications cannot assume that they have exclusive access to any system resources, such as a CD or DVD drive.
Mac OS X是一个多用户系统,不仅仅是支持多个用户帐号,也支持多个用户同时使用计算机。这一个功能使用的是叫做快速用户切换的技术,它让用户可以交换使用计算机而不用登出当前用户。在多用户的环境下,如果程序没有仔细考虑共享资源的使用,则可能会引起冲突。共享内存,缓存文件,信号量,命名管道等都必须加上标记以区分以免在同一程序在多个会话中运行时引起数据损坏。程序不能总是假设自己是系统资源的唯一用户,如CD或者DVD驱动器。
When considering access by multiple users, there are some specific things to keep in mind for your program design:
在考虑多用户环境下的程序设计时,如下几点需要注意:
- Named resources that might potentially be accessible to an application from multiple user sessions should incorporate the session ID into the name of the resource. This applies to cache files, shared memory, semaphores, and named pipes, among others.
- 在多用户环境下被访问的命名资源应将会话的ID作为名字的一部分,如缓存文件,共享内存,信号量,命名管道等。
- Not all users have the same privileges. For example, only administrator users can write files in
/Applications. Some users may be working under limited privileges and have limited access to some parts of the system. In particular, they may not be able to do the following:
不是所有的用户都有同样的权限。例如,只有管理用户可以往/Applications写入文件。一些用户的权限可能不足以访问系统的下面的这些资源:- Access all panes in System Preferences
系统偏好设置中的所有面板 - Modify the Dock
对Dock的更改 - Change their password
密码的更改 - Burn DVDs and CDs
录制DVD和CD - Open certain applications
一些特定的应用程序
- Access all panes in System Preferences
- Users on a computer can include both local and network users, so do not assume a user’s home directory is on a local volume. You may be accessing a network volume instead.
计算机上的用户可能是本地用户,也可能是网络用户,所以不要总是假设用户的主目录是在本地的卷上,所以您可能需要访问网络上的卷。
The document Multiple User Environments describes issues that arise from the existence of multiple users on a system. It also covers programmatic techniques for identifying users and protecting your application data from external corruption.
多用户环境描述了多用户导致的一些问题。它同样提供了标识用户以及保护您的程序数据不会被损坏的编程技术。