3. •Most computers can only execute one
program instruction at a time, but
because they operate so fast, they
appear to run many programs and
serve many users simultaneously.
•The computer operating system gives
each program a "turn" at
running, then requires it to wait while
another program gets a turn. Each of
these programs is viewed by the
operating system as a task for which
certain resources are identified and
kept track of.
4. The operating system manages each
application program in your PC system
(spreadsheet, word processor, Web
browser) as a separate task.
If the program initiates an I/O
request, such as reading a file or writing
to a printer, it creates a thread.
5. In a two state process model from time
to time the currently running process
will be interrupted and the dispatcher
portion of the OS will select some other
process to run.
The unit of dispatching is usually
referred to as a thread or lightweight
process.
7. Multithreading refers to the ability of an
OS to support multiple, concurrent paths of
execution within a single process.
8.
9. SINGLE THREADED APPROACHES
•MS-DOS supports a single user process
and a single thread.
•Some UNIX, support multiple user
processes but only support one thread
per process.
10. MULTITHREADED APPROACHES
•Java run-time environment is a single process
with multiple threads
•Multiple processes and threads are found in
Windows, Solaris, and many modern versions of
UNIX
12. BENEFITS OF THREADS
• It takes far less time to create a new
thread than to create a brand-new
process.
• It takes less time to terminate a thread
than a process
• It takes less time to switch between
two threads within the same process
than to switch between processes.
• Threads enhances efficiency in
communication between different
executing programs.
14. CONCLUSION
•Threads are mini processes or lightweight
processes.
• They reside in the same address space and
have access to the same data.
•It enhances efficiency.