Explain multithreading model in detail.

1 Answer

Answer :

Many systems provide support for both user and kernel threads, resulting in different multithreading models.

Following are three multithreading model:


Many-to-One Model

The many-to-one model maps many user-level threads to one kernel thread.

Thread management is done by the thread library in user space, so it is efficient; but the entire process will block if a thread makes a blocking system call.

Also, because only one thread can access the kernel at a time, multiple threads are unable to nm in parallel on multiprocessors.

Example: Green threads- a thread library available for Solaris

image

Advantages:

More concurrency because of multiple threads can run in parallel on multiple CPUs.

Less complication in the processing.

Disadvantages:

Thread creation involves light-weight process creation.

Kernel thread is an overhead.

Limiting the number of total threads.

One-to-One Model

The one-to-one model maps each user thread to a kernel thread.

It provides more concurrency than the many-to-one model by allowing another thread to run when a thread makes a blocking system call; it also allows multiple threads to run in parallel on multiprocessors.

The only drawback to this model is that creating a user thread requires creating the corresponding kernel thread.

Because the overhead of creating kernel threads can burden the performance of an application, most implementations of this model restrict the number of threads supported by the system.

Linux, along with the family of Windows operating systems, implement the one-to-one model.


image

Advantages:

Mainly used in language system, portable libraries.

One kernel thread controls multiple user thread.

Disadvantages:

Parallelism is not supported by this model.

One block can blocks all user threads.

Many-to-Many Model

The many-to-many model multiplexes many user-level threads to a smaller or equal number of kernel threads.

The number of kernel threads may be specific to either a particular application or a particular machine (an application may be allocated more kernel threads on a multiprocessor than on a uniprocessor). 

The one-to-one model allows for greater concurrency, but the developer has to be careful not to create too many threads within an application (and in some instances may be limited in the number of threads she can create).

The many-to-many model suffers from neither of these shortcomings: developers can create as many user threads as necessary, and the corresponding kernel threads can run in parallel on a multiprocessor.

Also, when a thread performs a blocking system call, the kernel can schedule another thread for execution.

image

Advantages:

Many threads can be created as per user’s requirement.

Multiple kernel or equal to user threads can be created.

Disadvantages:

True concurrency cannot be achieved.

Multiple threads of kernel is an overhead for operating system

Related questions

Description : Enlist different file allocation methods? Explain contiguous allocation method in detail.

Last Answer : From the user's point of view, a file is an abstract data type. It can be created, opened, written, read, closed and deleted without any real concern for its implementation. The implementation of a ... a times is difficult to estimate. 4. Compaction may be required and it can be very expensive.

Description : Enlist the operating system tools. Explain any two in detail.

Last Answer : Following are the operating tools: User Management Security policy Device Management Performance Monitor Task Scheduler A) User management: User management includes everything ... routing tables, interface statistics, masquerade connections, and multicast memberships. # netstat -tulpn

Description : List components of OS. Explain process management in detail.

Last Answer : List of System Components: 1. Process management 2. Main memory management 3. File management 4. I/O system management 5. Secondary storage management Process Management: The operating ... synchronization. 4. A mechanism for process communication. 5. A mechanism for deadlock handling.

Description : Enlist types of operating system. Explain multiprogramming OS in detail.

Last Answer : Types of operating system 1.Batch Systems 2.Multiprogramming 3.Multitasking 4.Time-Sharing Systems 5.Desktop Systems 6.Distributed system 7.Clustered system 8.Real Time system: Multiprogramming ... multiprogramming: user can open word, excel, access and other applications in a system.

Description : List free space management techniques? Describe any one in detail.

Last Answer : A file system is responsible to allocate the free blocks to the file therefore it has to keep track of all the free blocks present in the disk. There are mainly four approaches by using which, the free ... block. This block contains a pointer to the next free disk block, and so on.

Description : With neat diagram explain inter process communication model.

Last Answer : Inter-process communication: Cooperating processes require an Interprocess communication (IPC) mechanism that will allow them to exchange data and information. There are two models of IPC 1. ... a communication link between them. Between each pair of processes exactly one communication link.

Description : Explain LRU page replacement algorithm for following reference string. 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1 Calculate the page fault.

Last Answer : LRU: The Least Recently Used (LRU) page replacement policy replaces the page that has not been used for the longest period of time. LRU replacement associates with each page the time of that page's last use. ... in question so assume frame size as 3 or 4) LRU: Assume frame size=3

Description : Explain PCB with diagram.

Last Answer : Each process is represented as a process control block (PCB) in the operating system. It contains information associated with specific process. Process State: It indicates current state of a process. ... . Each PCB gives information about a particular process for which it is designed.

Description : Explain Round Robin algorithm with suitable example.

Last Answer : It is preemptive scheduling algorithm. A small unit of time known as a time quantum or time slice is used for pre-emption of a currently running process. Ready queue is implemented as a circular ... has received 1 time quantum, the CPU returns to process P1 for an additional time quantum. 

Description : Explain partitioning and its types.

Last Answer : An important operation of memory management is to bring programs into main memory for execution by the processor. Partitioning is a technique that divides a memory into multiple partitions. These partitions ... in memory. For example: Consider following table with process and memory space.

Description : Explain deadlock? What are necessary conditions for deadlock?

Last Answer : In multiprogramming environment, several processes may compete for a finite number of resources. A process requests resources and if the resources are not available then the process enters into the ... Each process is waiting for the resources held by other waiting processes in circular form.

Description : Explain any four scheduling criteria.

Last Answer : 1. CPU utilization: In multiprogramming the main objective is to keep CPU as busy as possible. CPU utilization can range from 0 to 100 percent. 2.Throughput: It is the number of processes ... fairly early and can continue computing new results while previous results are being output to the user.

Description : Explain any 4 services provided by OS.

Last Answer : 1.User Interface: All operating systems have a user interface that allows users to communicate with the system. Three types of user interfaces are available: a. Command line interface ( ... to system resources. Security is provided by user authentication such as password for accessing information.

Description : List any four features of open source operating system.

Last Answer : 1. Open Source: open source OS code is freely available and it is community based development project. Multiple team's works in collaboration to enhance the capability of operating system and it is ... issuing a command in Linux Terminal or Shell. Linux can also run Windows applications if needed.

Description : State and describe types of scheduler.

Last Answer : There are three types of scheduler: Long term scheduler Short term scheduler Medium term scheduler 1. Long term scheduler: It selects programs from job pool and loads them into the ... scheduler works in close communication with long term scheduler for loading process into the main memory. 

Description : What is purpose of system call? State two system calls with their functions.

Last Answer : System call provides an interface between a running program and operating system. It allows user to access services provided by operating system. This system calls are procedures written using C, ... send, receive messages transfer status information attach or detach remote devices. 

Description : Write Unix command for following: i)create a folder OSY ii) create a file FIRST in OSY folder iii) List/display all files and directories. iv) Write command to clear the screen

Last Answer : i) create a folder OSY: $mkdir OSY ii)create a file FIRST in OSY folder: $cd OSY $cat>FIRST or $ touch FIRST iii) List/display all files and directories: $ls iv) to clear screen: $clear

Description : Describe sequential and direct access method.

Last Answer : Sequential access: Information from the file is processed in order i.e. one record after another. It is commonly used access mode. For example, editors and compilers access files in sequence. A read ... prevent the user from accessing portions of the file system that may not be part of his file.

Description : Describe I/O Burst and CPU Burst cycle with neat diagram.

Last Answer : CPU burst cycle: It is a time period when process is busy with CPU.  I/O burst cycle: It is a time period when process is busy in working with I/O resources. A process execution consists ... cycle and so on. The final CPU burst cycle ends with a system request to terminate execution.

Description : Describe any four file attributes

Last Answer : File attributes: Name: The symbolic file name is the only information kept in human readable form. Identifier: File system gives a unique tag or number that identifies file within file ... Last modification and last use. These data can be useful for protection, security and usage monitoring.

Description : Write syntax for following commands: i)Sleep ii)Kill

Last Answer : i)sleep Syntax: sleep NUMBER[SUFFIX]… sleep OPTION ii) kill Syntax: kill pid

Description : Define virtual memory

Last Answer : Virtual memory is a memory management capability of an operating system (OS) that uses hardware and software to allow a computer to compensate for physical memory shortages by temporarily transferring data ... can be placed in overlays, but can concentrate instead on the problem to be programmed. 

Description : Draw process state diagram.

Last Answer : process state diagram

Description : Define real time operating system. List its any four applications of it.

Last Answer : Real time Operating System: A real time system has well defined fixed time constraints. Processing should be done within the defined constraints -Hard and Soft real time system. OR The ... Applications: 1. Flight Control System 2. Simulations 3. Industrial control 4. Military applications

Description : Explain multithreading in Java ?

Last Answer : Ans. 1. Multithreading provides better interaction with the user by distribution of task 2. Threads in Java appear to run concurrently, so it provides simulation for simultaneous activities. The ... this method cannot do anything elsewhile awaiting the arrival of another byte on the stream.

Description : What is fine grained multithreading?

Last Answer : This multithreading switch between threads on each instruction, resulting in interleaved execution of multiple treads

Description : What is meant by hardware multithreading?

Last Answer : Hardware multithreading allows multiple threads to share the functional units of a single processor in an overlapping fashion to try to utilize the hardware resources efficiently. To permit this sharing ... duplicate the independent state of each thread. It Increases the utilization of a processor.

Description : What is Multithreading?

Last Answer : Multithreading allows multiple threads to share the functional units of a single processor in an overlapping fashion. To permit this sharing, the processor must duplicate the independent state of each thread.

Description : State true or false for the following statements in Java. i) Java beans slow down software development process. ii) Java Servlets do not have built in multithreading feature. A) i-false, ii-false B) i-false, ii-true C) i-true, ii-false D) i-true, ii-true

Last Answer : A) i-false, ii-false

Description : State whether true or false. i) Multithreading is useful for application that perform a number of essentially independent tasks that do not be serialized. ii) An example of multithreading is a database server that listens for ... B) i-True, ii-True C) i-False, ii-True D) i-False, ii-False

Last Answer : B) i-True, ii-True

Description : .................. refers to the ability of an operating system to support multiple threads of execution with a single process. A) Multithreading B) Multiprocessing C) Multiexecuting D) Bi-threading

Last Answer : A) Multithreading

Description : Please explain "Exercise-Related Transient Abdominal Pain (ETAP)? See detail.

Last Answer : Well. I used to get them in the 60s when I did The Twist. I sometimes got them doing sit ups. They are muscle spasms along your rib cage from excercise.

Description : Would you explain how passes work, let's say from a gym that opens from 6 to 2 am? See detail.

Last Answer : …By the way opening horur 6 am

Description : Can you please explain to me in detail how buying and selling for profit works?

Last Answer : answer:Are you talking about trading in US shares and bonds or looking into Spanish investments, about which I know nothing. Is your permanent address a Spanish one? If so, none of the investments that ... rich-quick schemes are dangerous and often fatal. Slow and steady works best in the long run.

Description : Is the U.S. following in the footsteps of Rome's collapse? Explain Your Reasoning In Detail.

Last Answer : Definately. If history teaches us nothing else it is that great nations eventually fall.

Description : Explain in detail about Data objects in C Language. -Technology

Last Answer : Definition: A Data object represents a container for data values, a place where data values may be stored and later retrieved.Definition: A runtime grouping of one or more pieces of data in a virtual ... component is often represented by a pointer value. And may be modified by a change in pointer.

Description : Explain in detail about C Language. -Technology

Last Answer : C is acomputer programming language. That means that you can use C to create lists of instructions for a computer to follow. C is one of thousands of programming languages currently in ... compiled and linkedControl of function and object visibility to other files via extern and static attributes

Description : Explain in detail about identifiers in C Language. -Technology

Last Answer : IdentifiersIdentifiers are names for entities in a C program, such as variables, arrays, functions, structures, unions and labels. An identifier can be composed only of uppercase, lowercase letters, ... 31 characters.7.Identifiers must be meaningful, short, quickly and easily typed and easily read.

Description : Explain in detail about Data types in C Language. -Technology

Last Answer : Data types in C LanguageData types specify how we enter data into our programs and what type of data we enter. C language has some predefined set of data types to handle various kinds of data that we ... values. Every variable which is used in the program must be declared as what data-type it is.

Description : 1. The ionic compound made from aluminum and chlorine has the formula AlCl3. Explain in detail why it is the correct formula?

Last Answer : ionic bonding

Description : What is non-redox sales ? Explain in detail.

Last Answer : When new compounds are formed from one or more reactants, the reaction is called non-redox reaction if electrons are not exchanged between the existing elements.

Last Answer : According to ancient Indian aromatherapy , the aroma of bay leaves has a special beneficial effect on the body and mind. Bay leaves are an integral part of the kitchen. Bay leaves are used to enhance the ... it out of the kitchen and use bay leaves to get rid of thousands of body and mind problems.

Description : What do you see in the future? Work from home, on-site at the office, or a hybrid of the two? Explain in detail.?

Last Answer : Let us first understand that working from home is nothing new in the Western countries and it has been around for a while. It was that it started when the pandemic happened, but it was ... of the workforce with the help of digital tools and ensuring that everyone is doing their respective tasks

Description : Explain in detail the body plan in animals.

Last Answer : Explain in detail the body plan in animals.

Description : Observe the given figure and explain in detail.

Last Answer : Observe the given figure and explain in detail.

Description : Explain in detail the two stages of gametophytic phase in life cycle of Mosses.

Last Answer : Explain in detail the two stages of gametophytic phase in life cycle of Mosses.

Description : Explain in detail the class of kingdom fungi which includes yeast.

Last Answer : Explain in detail the class of kingdom fungi which includes yeast.

Description : Explain in detail general characters of Kingdom Fungi.

Last Answer : Explain in detail general characters of Kingdom Fungi.

Description : Explain in detail the importance of Indian Ocean to India.

Last Answer : Explain in detail the importance of Indian Ocean to India.

Description : Explain in detail what is a balanced diet; name a nutrient present in each of the following food: 1. Apple 2. Bread 3. Meat 4. Butter 5. Orange 6. Egg 7. Milk 8. Spinach

Last Answer : Answers: 1. Vitamin C 2. Starch 3. Vitamin A 4. Vitamin A 5. Vitamin C 6. Vitamin D 7. Vitamin A, C, D 8. Vitamin K