11月13日 OS作業

名稱
OS作業
日期
11月13日
課程名稱
作業系統
指導教師
劉艾華
心得
1. Which situation is suitable to use message passing instead of shared-memory model for communication between processes? What are the pros and cons of using these two models?

When packets of information in predefined formats are moved between processes by the operating system,you can use message passing.

Advantages of the Message Passing Model: One of the biggest semantic advantages of themessage-passing communication model is the fact that it is, by nature, interrupt driven. Messages combine both data and synchronization in a single unit.

Disadvantages of Message Passing: In addition to requiring the explicit management of data and communication, the message passing paradigm has one intrinsic disadvantage that can be mitigated but not eliminated by good interface design: the presence of higher endpoint costs in message passing models as compared to shared memory.

Advantages of the Shared Memory Model:. One of the primary reasons for this is that shared memory shelters programmers from the details of interprocessor communication: the location-independent semantics of shared memory allow programmers to focus on issues of parallelism and correctness while completely ignoring issues of where data is and how to access it. This can allow the “quick construction” of algorithms that communicate implicitly through data structures. In some sense, the shared-memory communication model offers one of the simplest extensions of the uniprocessor programming paradigm to multiprocessors

Disadvantages of Shared Memory: One of the deficiencies of the shared-memory communication model is the fact that it is, by nature, a polling interface. While this can make for extremely efficient communication under some circumstances, it can have a negative impact on synchronization operations.

2. What is “system calls?” Please specify the functions and the purposes of a system call in a computer system.

System call provide the interface between a running program and the operating system.

System call is available to the operating system used by the application function call. Usually the system call will cause the system transferred to the program executed in kernel mode. System call is to allow the operating system to make smooth.

3.

Used to modify a copy of the source code of the OS and have it re-compiled. Data declarations, initializations, and constants, along with conditional compilation, produce an output-object version of the operating system that is tailored to the system decribed.

Used to create tables and the selection modules from a precompiled library. The needed modules are linked together to form the generated OS. The selection allows the library to contain the device drivers for all supported I/O devices, but only those needed are linked into the operating system.

Construct a system that is completely table driven. All the code is always part of the system, and selection occurs at execution time. System generation involves simply creating the appropriate tables to describe the system.