Q1. Differentiate between Multi-Programming and Multi-Threading.
|Multi Programming||Multi Threading|
|1. Multiprogramming is a rudimentary form of parallel processing in which several programs are run at the same time on one processor.||1. Multi-threading is the ability of a program or an operating system process to manage its use by more than one user at a time.|
|2. Since there is only one processor, there can be no true simultaneous execution of different programs.||2. Even manage multiple requests by the same user without having to have multiple copies of the program running in the computer.|
|3. Instead the operating system executes part of one program, then part of another, and so on.||3. In some situation a single application may be required to perform several similar tasks.|
|4. To the user it appears that all programs are executing at the same time.||4. Example as web server accepts client requests for web pages, images, sound and so forth. A busy web server may have several of clients. Concurrently accessing it, if the web server runs as a traditional single-threaded process, it would be able to service only one client at a time. The amount of time that a client might have to wait for its request to be serviced could be enormous.|
|5. The operating system selects a job from the job pool and starts executing a job, when that job needs to wait for any input/output operations the CPU are switched to another job. So the main idea here is that the CPU is never idle.||5. Resources sharing economy and utilization of multiprocessor architectures multi-threading concept can be used.|