Professional Documents
Culture Documents
Introduction: Operating System Support
Introduction: Operating System Support
Introduction The operating system layer Protection Processes and Threads Communication and invocation Operating system architecture Summary
Principles of Operating Systems
1.21
Examples:
Cluster computer systems
Principles of Operating Systems V system, Sprite
Middleware
runs on a variety of OS-hardware combinations remote invocations
Architecture
Protection
protect resource from illegitimate access
Concurrent processing
support clients access resource concurrently
Scheduling
Schedule the processing ofOperating the invoked Principles of Systems operation
Thread manager
Thread creation, synchronization and scheduling
Communication manager
Communication between threads attached to different processes on the same computer
Memory manager
Management of physical and virtual memory
Supervisor
Dispatching of interrupts, system call traps and other exceptions control of memory management unit and hardware caches processor and floating point unit register manipulations
Figure
Positioning Middleware
Network OSs are not transparent. Distributed OSs are not independent of computers.
Middleware
What is middleware? What is its function? Where is it located? Why does it exist?
Positioning Middleware
Middleware
1.23
In an open middleware-based distributed system, the protocols used by each middleware layer should be the same, as well as the interfaces they offer to applications. Why should they be open? Why should they not be open?
Principles of Operating Systems
Middleware Models
Distributed files
Examples?
Distributed objects
Examples?
Distributed documents
Examples?
Others?
Message-oriented middleware (MOM) Service oriented architecture (SOA) Document-oriented
Principles of Operating Systems
NOS
Middleware
Illegitimate access
Maliciously contrived code Benign code
contains a bug have unanticipated behavior
Heavyweight process
lightweight process
Thread
Abstraction of a single activity Benefits
Responsiveness Resource sharing Economy Utilization of MP architectures
Principles of Operating Systems
Execution environment
the unit of resource management Consist of
An address space Thread synchronization and communication resources such as semaphores and communication interfaces (e.g. sockets) Higher-level resources such as open files and windows
Address space
Address space
a unit of management of a processs virtual memory Up to 232 bytes and sometimes up to 264 bytes consists of one or more regions
Region
an area of continuous virtual memory that is accessible by the threads of the owning process
Copy-on-write scheme
Thread 2 makes Receipt & requests to server queuing Thread 1 generates results
Input-output
Requests N threads
Client
Server
workers
remote objects
remote objects
remote objects
a. Thread-per-request
b. Thread-per-connection
c. Thread-per-object
(a) would be useful for UDP-based service, e.g. NTP (b) is the most commonly used - matches the TCP connection model (c) is used where the service is encapsulated as an object. E.g. could have multiple shared whiteboards with one thread each. Each object has only one thread, avoiding the need for thread synchronization within objects.
Principles of Operating Systems
Threads implementation
Threads can be implemented:
in the OS kernel (Win NT, Solaris, Mach) at user level (e.g. by a thread library: C threads, pthreads), or in the language (Ada, Java).
+ + + lightweight - no system calls modifiable scheduler low cost enables more threads to be employed not pre-emptive can exploit multiple processors page fault blocks all threads
Dynamic stack
Memory sharing
rapid communication between processes in the same computer
Choice of protocol
TCP/UDP
E.g. Persistent connections: several invocations during one
OSs buffer collect several small messages and send them together
Asynchronous operation
Performance characteristics of the Internet
High latencies, low bandwidths and high server loads Network disconnection and reconnection. outweigh any benefits that the OS can provide
Asynchronous operation
Concurrent invocations
E.g., the browser fetches multiple images in a home page by concurrent GET requests
Microkernel
Hybrid approaches
Principles of Operating Systems
Summary
Process & thread
A Process consists of multiple threads and an execution environment Multiple-threads: cheaper concurrency, take advantage of multiprocessors for parallelism
OS architecture
Monolithic kernel & microkernel
Principles of Operating Systems
System layers
Applications, serv ic es Middleware
OS1 Proc es ses, threads , communication, ... Computer & network hardware Node 1
Platf orm
Node 2
Computer and network hardware
Platf orm
Core OS functionality
Proc es s manager
Memory manager
Stack
Text 0
Principles of Operating Systems
Copy-on-write scheme
Process As address space Process Bs address space
RA
RB copied from RA
RB
a) Before write
remote objec ts
a. Thread-per-request
b. Thread-per-c onnection
c. Thread-per-objec t
Thread 1
Thread 2
Us er 1
(c) R PC/RMI (between computers)
Kernel
Us er 2
Thread 1
Network
Thread 2
Us er 1 Kernel 1 Kernel 2
Us er 2
2000
A stac k
1. Copy args
Us er Kernel
stub
stub
2. Trap to Kernel
3. Upc all
5. Return (trap)
Receiv e unmarshal ex ec ut e reques t mars hal Send Receiv e unmarshal ex ec ut e reques t mars hal Send
t im e
Monolithic Kernel
Microk ernel
....
Microkernel
Hardware