心得分享

Card image cap

楊同學 報告/作業 分享經驗 11/12 11/6 OS作業

11/12 11/6 OS作業
名稱 11/6 OS作業
日期 11/12
課程名稱 作業系統
指導教師 劉艾華

1 Advantages of message-passing communication model
The hardware cam be simpler
Communication explicit, simpler to understand
Explicit communication focuses attention on costly aspect of parallel computer , sometimes leading to improved structure in multiprocessor program
Synchronization is naturally associated with sending messages , reducing the possibility for errors introduced by incorrect synchronization
Easier to use sender-initiated communication, which may have some advantage in performance

Advantages of share-memory communication model
Compatibility with SMP hardware
Ease of programming when communication patterns are complex or very dynamically during execution
Ability to develop applications using familiar SMP model, attention only on performance critical accesses
Lower communication overhead, better use of BW for small items, due to implicit communication and memory mapping to implement protection in hardware, rather than through the I/O system
HW-controlled caching to reduce remote comm. By caching of all data, both shared and private

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. This has been enough of a concern that many multiprocessor architects have
augmented the basic shared-memory communication model with additional synchronization mechanisms.
Another disadvantage of shared memory is that every “real” communication operation
requires a complete network round-trip; no one-way communication of data is possible.

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. The cost of assembling and disassembling
messages, often called marshaling cost, is intrinsic to message passing because messages are,by
nature, transient and unassociated with computational data structures. At the source of a message,
data is gathered together from memory based data structures and copied into the network. At the
destination, the reverse must occur, namely data must be copied from the network into memory
based data structures. This is an intrinsic cost of message passing and may be contrasted with
shared memory, for which data remains associated with memory-based data structures at all times,
even during communication.
It is important to note, however, that the marshaling cost of message passing can be less of
an issue in comparison with shared memory when implementation and communication patterns
are taken into consideration. For instance, communication patterns that exhibit poor cache locality
and multiple round-trip network latencies can strongly degrade the performance of hardware-based
shared-memory mechanisms. Further, certain classes of communication require copying anyway;
page migration is a good example of this. In such cases, the marshaling cost in message passing is
directly matched by copying costs in shared memory.

2-1 System calls provide an interface between the process an the operating system. System calls allow user-level processes to request some services from the operating system which process itself is not allowed to do. In handling the trap, the operating system will enter in the kernel mode, where it has access to privileged instructions, and can perform the desired service on the behalf of user-level process. It is because of the critical nature of operations that the operating system itself does them every time they are needed. For example, for I/O a process involves a system call telling the operating system to read or write particular area and this request is satisfied by the operating system.

System programs provide basic functioning to users so that they do not need to write their own environment for program development (editors, compilers) and program execution (shells). In some sense, they are bundles of useful system calls.

2-2 System calls can be roughly grouped into five major categories:

Process Control load execute end, abort create process (for example, fork on Unix-like systems, or NtCreateProcess in the Windows NT Native API) terminate process get/set process attributes wait for time, wait event, signal event allocate, free memory
File management create file, delete file open, close read, write, reposition get/set file attributes
Device Management request device, release device read, write, reposition get/set device attributes logically attach or detach devices
Information Maintenance get/set time or date get/set system data get/set process, file, or device attributes
Communication create, delete communication connection send, receive messages transfer status information attach or detach remote devices

3-1 Used to modify a copy of the source code of the OS and have it re-compiled.
Used to create tables and modules from a precompiled library. The needed modules are linked together to form the generated OS.
3-2 The size and generality of the generated system and the ease of modification as the hardware configuratio

更新日期:2015/11/13 上午 01:07:22