0% found this document useful (0 votes)
0 views

IntroMultithreading

Multithreading allows multiple sub-programs (threads) to run simultaneously within a main program, each having its own flow of control, unlike multitasking which involves multiple independent processes. Threads are lighter than processes, making them more efficient for tasks such as animations, games, and web services. The document outlines the basic concepts of processes, multitasking, and the advantages of multithreading.

Uploaded by

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

IntroMultithreading

Multithreading allows multiple sub-programs (threads) to run simultaneously within a main program, each having its own flow of control, unlike multitasking which involves multiple independent processes. Threads are lighter than processes, making them more efficient for tasks such as animations, games, and web services. The document outlines the basic concepts of processes, multitasking, and the advantages of multithreading.

Uploaded by

panwar14
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Introduction to Multithreading

• When we run a program , the running program is called ‘Process’

• A running program(process) will have its own ow of control


• When a single process is running then its called “uni-tasking”

• When more than one process is running then its called “Multitasking”

• If two programs are running simultaneously then theses two programs will have
its own ow of control

• Hardware( CPU) will execute some lines of program 1 then some lines of
program 2 then again 1 then 2 so on… this gives us the impression that they
are running simultaneously but only one core I.e, CPU will execute these
programs at a time
fl
fl
• Multithreading is same as multitasking but the di erence is , in a main
program they are sub independent program that run simultaneously and each
sub program is having its own ow control.

• A process is a heavy process , but a thread is a light weighted process because


they are children of main program.

Advantages of Multithreading :
- We can create animations
- We can create games
- Chatting between multiple users
- Providing web services for multiple clients connected to the server at a time
fl
ff

You might also like