Você está na página 1de 3

AACS5164 Distributed Computer Systems

Tutorial 2

Tutorial 2
Q1. Compare microkernel with monolithic kernels.
Monolithic Kernels Monolithic systems have large kernels that include most operating system services, including process, memory, file name, and device management as well as interprocess communication. Another word for monolithic is secure Large bigger size than Microkernel No easy to extend. Bad Maintenance. If want to modify some feature on this kernel, its need to recompile for all kernel. So I take longer time to complete. Eg: Linux, Dots, Unix Microkernel Kernels Microkernels only provide minimal services (Basic Service) on Operating System, such as interprocess communication and limited device, process, thread, and memory management. All other services are implemented above the kernel as user-space operating system services. Example, minic, Machinston. -Easy to extend and reconfigure -Easy Design and implement Eg: Window 7,Minix ,Omiga OS

Q2. Why microkernel are design to be layered?


Enhancing portability- more modular, easy to design, implement, install, extend and reconfigure. Increased security - The protection of system processes from being modified by the user or other processes. Make it more portable and easy to migrate (Move from one location to other location).

Q3. What are the differences between process and thread?


1. Threads share the address space of the process that created it; processes have their own address. 2. Threads have direct access to the data segment of its process; processes have their own copy of the data segment of the parent process. 3. Threads can directly communicate with other threads of its process; processes must use interprocess communication to communicate with sibling processes. 4. Threads have almost no overhead; processes have considerable overhead. 5. New threads are easily created; new processes require duplication of the parent process. 6. Threads can exercise considerable control over threads of the same process; processes can only exercise control over child processes. 7. Changes to the main thread (cancellation, priority change, etc.) may affect the behavior of the other threads of the process; a change to the parent process does not affect child processes. Process - Each process provides the resources needed to execute a program. A process has a virtual address space, executable code, open handles to system objects, a security context, a unique process identifier, environment variables, a priority class, minimum and maximum working set sizes, and at least one thread of execution. Each process is started with a single thread, often called the primary thread, but can create additional threads from any of its threads. Thread - A thread is the entity within a process that can be scheduled for execution. All threads of a process share its virtual address space and system resources. In addition, each thread maintains exception handlers, a scheduling priority, thread local storage, a unique thread identifier, and a set of structures the system will use to save the thread context until it is scheduled. The thread context includes the thread's set of machine registers, the kernel stack, a thread environment block, and a user stack in the address space of the thread's process. Threads can also have their own security context, which can be used for impersonating clients

1
-sh-

AACS5164 Distributed Computer Systems

Tutorial 2

Q4. Illustrate the THREE multithreaded process paradigms.


Specialist Paradigm - different check in process with their specialize area - Thread A, B,C may perform a unique or the same specialized function for process A. Client/ Server Paradigm - The client thread passes the request to an appropriate server thread. Assembly Line Paradigm -request will be pass 1 by follow phases until process result.

Q5. compare divisible process with indivisible process. Indivisible processes -Entire process must be assign to a single processor
-Not able to take advantage of the additional resources available in a distributed and parallel environment.

Divisible processes - a process may be subdivided into smaller sub-processes, tasks, or threads.

Q6. Differentiate kernel-level support threads with user level support threads. User-level support Kernel-level support Table = number of entry flexible Table = number of entry fix Run faster kernel trap (doesnt involve OS, no Run slower kernel trap need memory) Type of scheduling Under control fully control by kernel If 1 state thread of process block then whole process been block (not suitable in use where system always been block)

1) Operating system has the knowledge of existence of kernel level threads while it does not know about the existence of user-level threads. 2) Suppose a process P1 has 2 kernel level threads and P2 has 2 user-level threads. If one thread in P1 gets blocked, its second thread is not affected. But in case of P2 if one thread is blocked (say for I/O), the whole process P2 along with the 2nd thread gets blocked. 3) Kernel level threads are slower to create compared to user-level threads. 4) Switching in Kernel level thread involves OS scheduler while in user-level threads OS scheduler is not involved. 5) Context switching between kernel level threads has high overhead, almost the same as a process. Context switching between user-level threads has almost no overhead as compared to kernel level threads. 6) Kernel level threads can run on different processors simultaneously while user-level threads of a process will run on one processor only even if multiple processors are available. 7) User level support threads are faster than kernel level support thread than 100times.

2
-sh-

AACS5164 Distributed Computer Systems

Tutorial 2

Q7. Give any TWO advantages of user-level support threads.

Advantages: -The primary advantages of user-level threads are efficiency and flexibility. Because the operating system is not involved, user-level threads can be made to use very little memory and can be created and scheduled very quickly. - user able to decide which thread to process first, able to select which thread to proceed first. - User-level threads are also more flexible because the thread scheduler is in user code, which makes it much easier to schedule threads in an intelligent fashion -- for example, the application's priority structure can be directly used by the thread scheduler. - Table, run more faster than kernel-level, scalability Disadvantages The primary disadvantage of user-level threads compared to kernel threads is the lack of operating system support. For example, when a user-level thread makes a blocking call, the kernel does not start running another user-level thread. Instead, the kernel suspends the entire calling kernel thread or process, even though another user-level thread might be ready to run

Q8. Describe two disadvantages of utilizing a polled-loop scheduler for system scheduling.
Advantages: - Simple to write and debug /Very easy to code and debug. - The response time is easy to determine /Response time is easy to determine. - Excellent for handling high-speed data channels Disadvantages: - Not generally sufficient to handle complex systems/ cannot handle asynchronous events. - Inherently waste CPU time /Waste of CPU time, especially, when the program is continuously monitoring a status flag or variable. -May be too slow response time for certain parts of the system -Not suitable used in real time systems. -Busy in asking processor, because it not reactive, it occur to delay, _ latency due to the time necessary for communications, -The communication cost for getting or moving the data if they are not at the same location that the process is assigned to execute.

Q9. What are the responsibilities of the process management?


Address space contents Registers Program counter Stack pointer State of system call(s) All related threads of execution All files from the process and their state (open or closed)

Q10. How many data type translations are necessary in a heterogeneous environment with seven different architectures without using EDR? With using EDR? - (n)2 - n = (7)2-7 = 42

3
-sh-

Você também pode gostar