1) What is kernel level multithread and user level single thread ?
In a multithreading environment, threads can be managed at different levels: kernel-level and user-level. Here's an explanation of kernel-level multithreading and user-level single threading:
Kernel-Level Multithreading:
Definition: In kernel-level multithreading, the operating system's kernel is responsible for managing and scheduling threads. Each thread is represented as a separate kernel-level entity with its own program counter, stack, and register set.
Characteristics:
Kernel Involvement: The operating system's kernel is directly aware of and manages each thread.
Thread Switching: Thread switching involves kernel-level context switches, which can be more time-consuming.
Concurrency: True parallelism can be achieved as multiple threads can execute simultaneously on multiple processors or cores.
Advantages:
Parallelism: Kernel-level multithreading allows for true parallel execution of multiple threads.
Responsiveness: Kernel-level threads are managed by the operating system, providing better responsiveness.
Disadvantages:
Overhead: The overhead of kernel involvement in thread management can be higher compared to user-level threading.
Complexity: Kernel-level multithreading involves more complex synchronization and communication mechanisms.
User-Level Single Thread:
Definition: In user-level threading, thread management is handled entirely by the user-level application or a thread library without involving the operating system's kernel. The operating system is unaware of the presence of multiple threads in the application.
Characteristics:
Kernel Unaware: The operating system is unaware of individual threads; it sees only a single thread of execution.
Thread Switching: Thread switching occurs at the user level, involving user-level context switches, which can be more efficient.
Concurrency: True parallelism may not be achieved, as the operating system sees only a single thread.
Advantages:
Reduced Overhead: User-level threading typically incurs less overhead than kernel-level threading due to fewer system calls.
Flexibility: The application has more control over thread management, allowing for customized strategies.
Disadvantages:
Lack of Parallelism: Since the operating system sees only one thread, true parallel execution on multiple processors may not be possible.
Limited Responsiveness: User-level threads are subject to limitations imposed by the operating system scheduler.
In summary, kernel-level multithreading involves the operating system's direct management of threads, allowing for true parallelism but with higher overhead. On the other hand, user-level single threading involves managing threads at the user level, providing lower overhead but potentially limiting parallelism and responsiveness. The choice between these models depends on the specific requirements and constraints of the application.
2) Dead lock in os ? All conditions, handling strategies and resource allocation graph.
Introduction of Deadlock in Operating System - GeeksforGeeks
3) deadlock conditions and handling
What are Semaphores in Operating Systems?
Semaphores refer to the integer variables that are primarily used to solve the critical section problem via combining two of the atomic procedures, wait and signal, for the process synchronization.
4) spin lock
Critical section
5) process synchronisation
Process Synchronization is the coordination of execution of multiple processes in a multi-process system to ensure that they access shared resources in a controlled and predictable manner
Independent Process: The execution of one process does not affect the execution of other processes.
Cooperative Process: A process that can affect or be affected by other processes executing in the system.
6) Interprocess communication
Comments
Post a Comment