0% found this document useful (0 votes)
60 views5 pages

Superior University Lahore: Multithreading in Windows

Windows uses multithreading to allow programs to be responsive even during long redraws by assigning drawing to a separate thread. Multithreading in Linux treats threads as standard processes with no special kernel support. Java allows concurrent execution through multithreading, with each part called a thread that can execute independently for efficient use of CPUs.

Uploaded by

Abdul Manan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views5 pages

Superior University Lahore: Multithreading in Windows

Windows uses multithreading to allow programs to be responsive even during long redraws by assigning drawing to a separate thread. Multithreading in Linux treats threads as standard processes with no special kernel support. Java allows concurrent execution through multithreading, with each part called a thread that can execute independently for efficient use of CPUs.

Uploaded by

Abdul Manan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

SUPERIOR UNIVERSITY LAHORE

Faculty of Computer Science & IT

Operating System
Assignment 4

Name: Abdul Manan


Roll No: bcsm-s19-022
Section: BSCS (5A)
Submitted to: Ma’am Arshia Naeem

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.

Multithreading has many benefits in windows applications, such as:

 Each child window in an MDI application can be assigned to a


different thread.

 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.

 However, we can assign a separate thread to the On Draw function,


thus causing the application to be responsive when long redraws
occur.

 Multiple threads can be concurrently executed if there are multiple


CPUs in the system thus speeding up the execution of the program.
 Complex simulations can be carried out efficiently by assigning a
separate thread to each simulation entity.

 Important events can be handled efficiently by assigning those to a


high priority thread.
Process 0 Process 1 .. Process n

Thread 0 Thread 1 Thread 0 Thread 1 Thread 0 Thread 1

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

Running State Termination


Ready Scheduling Executing Zombie

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

You might also like