Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
45 views

Multithreading in Windows: Process 0 Process 1 Process N

Windows uses multithreading to improve application responsiveness. It allows long processes like drawing to run concurrently without blocking the GUI. Multiple threads can take advantage of multiple CPUs to speed up program execution. Linux implements threads as standard processes and does not provide special threading mechanisms. Java supports multithreading which allows different parts of a program to run concurrently, improving performance on multi-CPU systems by maximizing resource utilization.

Uploaded by

Abdul Manan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Multithreading in Windows: Process 0 Process 1 Process N

Windows uses multithreading to improve application responsiveness. It allows long processes like drawing to run concurrently without blocking the GUI. Multiple threads can take advantage of multiple CPUs to speed up program execution. Linux implements threads as standard processes and does not provide special threading mechanisms. Java supports multithreading which allows different parts of a program to run concurrently, improving performance on multi-CPU systems by maximizing resource utilization.

Uploaded by

Abdul Manan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Multithreading in Windows

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

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