Superior University Lahore: Multithreading in Windows
Superior University Lahore: Multithreading in Windows
Operating System
Assignment 4
Multithreading in Windows
Multithreadin
g
in Windows
Paragraph
Windows is a preemptive multithreading operating system which
manages threads. Each program is assigned a single thread of execution
by default.
If the drawing part (On Draw code) of the program takes a long time
to execute, the GUI will be blocked until the redraw is completed.
Thread 2 Thread 2
CPU
Multithreading in Linux
Paragraph Multithreadin
g
in linux
Threads in Linux are
nothing but a flow of execution of the process. A process containing multiple
execution flows is known as multi-threaded process. For a non-multi-threaded
process there is only execution flow that is the main execution flow and hence it
is also known as single threaded process. Linux has a unique implementation of
threads. To the Linux kernel, there is no concept of a thread. Linux implements
all threads as standard processes. The Linux kernel does not provide any
special scheduling semantics or data structures to represent threads.
Stopped
Signal Signal
Event
Signal Uninterrupted
or
Event
Interrupted
Multithreading in Java
Paragraph Multithreadin
g
in JAVA
Java is a multi-
threaded programming language which means we can develop multi-threaded
program using Java. A multi-threaded program contains two or more parts that
can run concurrently and each part can handle a different task at the same time
making optimal use of the available resources specially when your computer
has multiple CPUs
Multithreading is a Java feature that allows concurrent execution of two or more
parts of a program for maximum utilization of CPU. Each part of such program
is called a thread. So, threads are light-weight processes within a process.
Runnable
Start
New Thread Run
New
Running
End of Execution
Sleep, Wait
Dead
Waiting