Multi threading

467 views

Published on

its a power point ppt describing multi threading

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
467
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Multi threading

  1. 1. MULTI THREADING
  2. 2. MULTI-THREADING <ul><li>Definition: </li></ul><ul><li>Process of executing a number of programs through a single program. The purpose of multi-threading program is to utilize the CPU processing time in maximum and to reduce CPU idle time. </li></ul>
  3. 3. THREAD <ul><li>By default, a program is known as single threaded program as it normally follows a single line of execution. </li></ul>
  4. 4. CREATION OF THREADS <ul><li>Threads can be created in two ways: </li></ul><ul><ul><li>By implementing “Runnable Interface” </li></ul></ul><ul><ul><li>By extending “Thread Class” </li></ul></ul>
  5. 5. THREAD LIFE CYCLE NEW (BORN) RUNNABLE BLOCKED DEAD Start( ) Stop( ) Run( ) Suspend( ) Wait( ) Sleep( ) Resume( ) Notify( ) Stop( ) Run( ) Stop( ) Run( )
  6. 6. JOIN METHOD <ul><li>It forces the parent thread to wait for the termination all of its child threads i.e. the parent thread exists in memory till the termination of all of its child threads. </li></ul>
  7. 7. THREAD CLASS <ul><li>String getname( ) </li></ul><ul><li>Int getpriority( ) </li></ul><ul><li>Set priority(in) </li></ul><ul><li>Current Thread </li></ul>
  8. 8. SYNCHRONISATION <ul><li>Technique of sharing a common resource between multiple threads </li></ul>

×