- 论坛徽章:
- 0
|
If an operating system makes spawning new processes expensive, you'll usually see all of the
following consequences:
l
Multithreading is extensively used for tasks that Unix would handle with multiple
communicating lightweight processes.
l
Learning and using asynchronous I/O is a must.
l
Monster monoliths become a more natural way of programming.
l
Lots of policy has to be expressed within those monoliths. This encourages C++ and
elaborately layered internal code organization, rather than C and relatively flat internal
hierarchies.
l
When processes can't avoid a need to communicate, they do so through mechanisms
that are clumsy, inefficient, and insecure, such as temporary files.
This is an example of common stylistic traits (even in applications programming) being
driven by a limitation in the OS environment.
To design the perfect anti-Unix, make process-spawning very expensive and leave IPC as an
unsupported or half-supported afterthought.
Internal boundaries
Unix has wired into it an assumption that the programmer knows best. It doesn't stop you or
request confirmation when you do dangerous things with your own data, like rm -fr *. On the
other hand, Unix is rather careful about not letting you step on other people's data.
Unix has at least three levels of internal boundaries that guard against malicious users or
buggy programs. One is memory management; Unix uses its hardware's memory
management unit (MMU) to ensure that separate processes are prevented from intruding on
the others' memory-address spaces. A second is the presence of true privilege groups for
multiple users 鈥 |
|