This is a discussion on multi tasking, multi programming, multi threading within the Operating Systems forums, part of the Computer Hardware/Software and Networking category; Hi Guys can anybody tell me about the multi tasking, multi programming, multi threading?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Cooperative multitasking/time-sharing When computer usage evolved from batch mode to interactive mode, multiprogramming was no longer a suitable approach. Each user wanted to see his program running as if it was the only program in the computer. The use of time sharing made this possible, with the concession that the computer would not seem as fast to any one user as it really would be if it were running only that user's program. Early multitasking systems consisted of suites of related applications that voluntarily ceded time to each other. This approach, which was eventually supported by many computer operating systems, is today known as cooperative multitasking. Although it is rarely used in larger systems, Microsoft Windows prior to Windows 95 and Windows NT, and Mac OS prior to Mac OS X both used cooperative multitasking to enable the running of multiple applications simultaneously. Cooperative multitasking has many shortcomings. For one, a cooperatively multitasked system must rely on each process to regularly give time to other processes on the system. A poorly designed program, or a "hung" process, can effectively bring the system to a halt. The design requirements of a cooperatively multitasked program can also be onerous for some purposes, and may result in irregular (or inefficient) use of system resources. To remedy this situation, most time-sharing systems quickly evolved a more advanced approach known as Pre-emptive multitasking|preemptive multitasking. Preemptive multitasking/time-sharing Preemptive multitasking allows the computer system to more reliably guarantee each process a regular "slice" of operating time. It also allows the system to rapidly deal with important external events like incoming data, which might require the immediate attention of one or another process. At any specific time, processes can be grouped into two categories: those that are waiting for input or output (called "IO bound|I/O bound"), and those that are fully utilizing the CPU ("CPU bound"). In early systems, processes would often "poll", or "Busy waiting|busywait" while waiting for requested input (such as disk, keyboard or network input). During this time, the process was not performing useful work, but still maintained complete control of the CPU. With the advent of interrupts and preemptive multitasking, these I/O bound processes could be "blocked", or put on hold, pending the arrival of the necessary data, allowing other processes to utilize the CPU. As the arrival of the requested data would generate an interrupt, blocked processes could be guaranteed a timely return to execution. Multiprogramming In the early days of computing, CPU time was expensive, and peripherals were very slow. When the computer ran a program that needed access to a peripheral, the CPU would have to stop executing program instructions while the peripheral processed the data. This was deemed very inefficient. The first efforts to create multiprogramming systems took place in the 1960s. Several different programs in batch were loaded in the computer memory, and the first one began to run. When the first program reached an instruction waiting for a peripheral, the context of this program was stored away, and the second program in memory was given a chance to run. The process continued until all programs finished running. Multiprogramming doesn't give any guarantee that a program will run in a timely manner. Indeed, the very first program may very well run for hours without needing access to a peripheral. As there were no users waiting at an interactive terminal, this was no problem: users handed a deck of punched cards to an operator, and came back a few hours later for printed results. Multiprogramming greatly reduced the waiting. As noted in the OS/360 entry its original O/S followed the above model but was replaced the very next year,1967, by MFT which set limits on the amount of CPU time any single process could consume before being switched out. The hours-long wait referred to above generally was related to the fact that computers simply weren't very fast as compared to today. Multithreading As multitasking greatly improved the throughput of computers, programmers started to implement applications as sets of cooperating processes (e.g. one process gathering input data, one process processing input data, one process writing out results on disk.) This, however, required some tools to allow processes to efficiently exchange data. Threads were born from the idea that the most efficient way for cooperating processes to exchange data would be to share their entire memory space. Thus, threads are basically processes that run in the same memory context. Threads are described as ''lightweight'' because switching between threads does not involve changing the memory context. While threads are scheduled preemptively, some operating systems provide a variant to threads, named ''fibers'', that are scheduled cooperatively. On operating systems that do not provide fibers, an application may implement its own fibers using repeated calls to worker functions. Fibers are even more lightweight than threads, and somewhat easier to program with, although they tend to lose some or all of the benefits of threads on machines with multiple processors. Some systems directly support multithreading in hardware. Thanks |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multi-Browser Compatibility | santhakumar | Web Design Help | 2 | 11-27-2007 09:16 PM |
| I have multi checkbox in my form... | gk_cloud | PHP Programming | 2 | 10-22-2007 06:31 AM |
| How to get multi combobox value in php | gk_cloud | PHP Programming | 8 | 10-16-2007 12:48 AM |
| Multi Language Website | kingmaker | ASP and ASP.NET Programming | 16 | 08-14-2007 06:49 AM |
| Multi-layer switching | vadivelanvaidyanathan | Server Management | 1 | 07-16-2007 10:05 AM |