Presentation is loading. Please wait.

Presentation is loading. Please wait.

OPERATING SYSTEM SUPPORT

Similar presentations


Presentation on theme: "OPERATING SYSTEM SUPPORT"— Presentation transcript:

1 OPERATING SYSTEM SUPPORT
Introduction The Operating System Layer Protection Processes and Threads Communication and Invocation Operating System Architecture

2 Introduction Many distributed operating systems have been investigated, but there are none in general/wide use. But network operating system are in wide use for various reasons both technical and non-technical. Users have much invested in their application software; they will not adopt a new operating system that will not run their applications.

3 Introduction The second reason against the adoption of distributed operating system is that users tend to prefer to have a degree of autonomy for their machines, even in a organization. Unix and Windows are two examples of network operating systems. Those have a networking capability built into them and so can be used to access remote resources using basic services such as rlogin and telnet.

4 Introduction The combination of middleware and network operating systems provides an acceptance balance between the requirement of autonomy and network transparency. The network operating systems allows users to run their favorite word processor and other standalone applications.

5 The Operating System Layer
Figure 1. System layers

6 The Operating System Layer
Figure 1 shows how the operating system layer at each of two nodes supports a common middleware layer in providing a distributed infrastructure for applications and services. Kernels and server processes are the components that manage resources and present clients with an interface to the resources.

7 The Operating System Layer
The OS facilitates: Encapsulation Protection Concurrent processing Invocation mechanism is a means of accessing an encapsulated resource.

8 The Operating System Layer
Figure 2. Core OS functionality

9 Process Manager: handles the creation of and operations upon processes.
Thread manager: Thread Creation, Synchronization and Scheduling. Threads are schedulable activities attached to processes Communication Manager: manages communication between threads attached to different processes on the same computer. Communication between threads in remote processes. 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.

10 Protection Resources require protection from illegitimate access
File protection by providing access privileges Hardware supports to protect modules: hard lock Kernel can control the memory management unit and set of processor registers so that no other code may access the machine’s physical resources except in acceptable way.

11 Process Processes and Threads
A process consists of an execution environment together with one or more threads. A thread is the operating system abstraction of an activity. An execution environment is the unit of resource management: a collection of local kernel managed resources to which its threads have access.

12 Processes and Threads An execution environment consists of :
An address space Thread synchronization and communication resources (e.g., semaphores, sockets) Higher-level resources (e.g., file systems, windows)

13 Threads Processes and Threads
Threads are schedulable activities attached to processes. The aim of having multiple threads of execution is : To maximize degree of concurrent execution between operations To enable the overlap of computation with input and output To enable concurrent processing on multiprocessors.

14 Processes and Threads Processes vs. Threads
Threads can be helpful within servers: Concurrent processing of client’s requests can reduce the tendency for servers to become bottleneck. E.g. one thread can process a client’s request while a second thread serving another request waits for a disk access to complete. Processes vs. Threads Threads are “lightweight” processes, processes are expensive to create but threads are easier to create and destroy.

15 Threads programming Processes and Threads
Thread programming is concurrent programming. Java provides methods for creating, destroying and synchronizing threads. The Java thread class includes the constructor and management methods listed in Figure 3. The thread and object synchronization methods are in Figure 4.

16 Processes and Threads Thread(ThreadGroup group, Runnable target, String name) Creates a new thread in the SUSPENDED state, which will belong to group and be identified as name; the thread will execute the run() method of target. setPriority(int newPriority), getPriority() Set and return the thread’s priority. run() A thread executes the run() method of its target object, if it has one, and otherwise its own run() method (Thread implements Runnable). start() Change the state of the thread from SUSPENDED to RUNNABLE. sleep(int millisecs) Cause the thread to enter the SUSPENDED state for the specified time. yield() Enter the READY state and invoke the scheduler. destroy() Destroy the thread. Figure 3. Java thread constructor and management methods

17 Processes and Threads Figure 4. Java thread synchronization calls
thread.join(int millisecs) Blocks the calling thread for up to the specified time until thread has terminated. thread.interrupt() Interrupts thread: causes it to return from a blocking method call such as sleep(). object.wait(long millisecs, int nanosecs) Blocks the calling thread until a call made to notify() or notifyAll() on object wakes the thread, or the thread is interrupted, or the specified time has elapsed. object.notify(), object.notifyAll() Wakes, respectively, one or all of any threads that have called wait() on object. Figure 4. Java thread synchronization calls

18 Processes and Threads Programs can manage threads in groups.
Every thread belongs to one group assigned at thread creation time. thread groups are useful to shield various applications running in parallel on one Java Virtual Machine (JVM). A thread in one group cannot perform management operations on a thread in another group. E.g., an application thread may not interrupt a system windowing (AWT) thread.

19 Thread synchronization
Processes and Threads Thread synchronization The main difficult issues in multi-threaded programming are the sharing of objects and the techniques used for thread coordination and cooperation. Each thread’s local variables in methods are private to it. Threads have private stack. Threads do not have private copies of static (class) variables or object instance variables.

20 Processes and Threads Java provides the synchronized keyword for thread coordination. any object can only be accessed through one invocation of any of its synchronized methods. an object can have synchronized and non-synchronized methods. example synchronized addTo() and removeFrom() methods to serialize requests in worker pool example.

21 Processes and Threads Threads can be blocked and woken up example
The thread awaiting a certain condition calls an object’s wait() method. The other thread calls notify() or notifyAll() to awake one or all blocked threads. example When a worker thread discovers that there are no requests to process, it calls wait() on the instance of Queue. When the I/O thread adds a request to the queue, it calls the queue’s notify() method to wake up the worker.

22 Client and server with threads
N threads Input-output Client Thread 2 makes T1 Thread 1 requests to server generates results Requests Receipt & queuing

23 Communication and Invocation
RMI, RPC, Events/Notifications Review OS Communication: what, which protocols Communication Primitive: doOperation, getRequest and sendReply Protocols and Openness: most OS in 1980s incorporated their own network protocols tuned to RPC interactions

24 Invocation Performance
Client and Server may make many millions of invocation related operations in their life times. However the network bandwidth improves invocation times have not decreased in proportion. NULL RPC is defined as an RPC without parameters that executes a null procedure and returns no values. Its execution involves an exchange of messages carrying some system data but not user data.

25 Invocation Performance
Null Invocation costs are important because they measure a fixed overhead, the latency. Invocation cost increase with the size of arguments and results, but in many cases the latency is significant compared with the remainder of delay. RPC bandwidth/throughput is also concern when data has to be transferred in bulk.

26 Invocation Performance
Marshalling: and unmarshalling which involve copying and converting data become significant when amount of data grows. Data copying: message data is copied several times in the course of RPC like from across the user-kernel boundary, across each protocol layer, between network interface and kernel buffers. Packet initialization: initializing protocol headers and trailers including checksums Thread Scheduling and Context switching

27 Operating System Architecture
The major kernel architectures: Monolithic kernels Micro-kernels Monolithic Kernels A monolithic kernel can contain some server processes that execute within its address space, including file servers and some networking. The code that these processes execute is part or the standard kernel configuration. (Figure 5)

28 Operating System Architecture
Microkernel The microkernel appears as a layer between hardware layer and a layer consisting of major systems. If performance is the goal, rather than portability, then middleware may use the facilities of the microkernel directly. (Figure 6)

29 Operating System Architecture
Figure 5. Monolithic kernel and microkernel

30 Operating System Architecture
Figure 6. The role of the microkernel

31 Operating System Architecture
Monolithic and Microkernel comparison The advantages of a microkernel extensibility Its ability to enforce modularity behind memory protection boundaries. Its small kernel has less complexity. The advantages of a monolithic The relative efficiency with which operations can be invoked because even invocation to a separate user-level address space on the same node is more costly.

32 Operating System Architecture
Hybrid Approaches Pure microkernel operating system such as Chorus & Mach have changed over a time to allow servers to be loaded dynamically into the kernel address space or into a user-level address space. In some operating system such as SPIN, the kernel and all dynamically loaded modules grafted onto the kernel execute within a single address space.

33 Operating System Architecture
An open distributed system should make it possible to: Run only that system software at each computer that is necessary for its particular role in the system architecture. For example, system software needs for PDA and dedicated server are different. Loading redundant modules wastes memory resources. Allow the software (and the computer) implementing any particular service to be changed independent of other facilities.

34 Operating System Architecture
Allow for alternatives of the same service to be provided, when this is required to suit different users or applications. Introduce new services without harming the integrity of existing ones.

35 Operating System Architecture
A guiding principle of operating system design: The separation of fixed resource management “mechanisms“ from resource management “policies”, which vary from application to application and service to service. For example, an ideal scheduling system would provide mechanisms that enable a multimedia application such as videoconferencing to meet its real-time demands while coexisting with a non-real-time application such as web browsing.

36 Operating System Architecture
The kernel would provide only the most basic mechanisms upon which the general resource management tasks at a node are carried out. Server modules would be dynamically loaded as required, to implement the required resource management policies for the currently running applications.


Download ppt "OPERATING SYSTEM SUPPORT"

Similar presentations


Ads by Google