IntroMultithreading
IntroMultithreading
• 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.
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