SlideShare a Scribd company logo
1 of 11
V.SAKTHIPRIYA
II-MSC(IT)
NADAR SARASWATHI COLLEGE OF ARTS AND SCIENCE
INTRODUCTION:
 Multithreading enables your Visual Basic program to
perform concurrent processing so that you can do more
than one operation at a time happening is that is divided
by the computer into slices, and start a new thread ,that
thread gets some time slices which means that threads
code can execute.
 Visual Basic program to perform concurrent processing so
that you can do more than one operation at a time.
THREAD PROPERTIES:
 Threads enable your program to perform concurrent
processing.
 The .NET Framework System. Threading namespace
makes using threads easier.
 Threads share the application's resources. For more
information, see Using Threads and
Threading.
CREATING A THREAD:
 create a new thread by declaring a variable of type Thread
and calling the constructor, providing the name of the
procedure or method that you want to execute on the new
thread.
Dim newThread As New
System.Threading.Thread(AddressOf AMethod)
STARTING A THREAD:
 To start the execution of a new thread, use the Start
method, as shown in the following code
newThread.Start()
STOPPING A THREAD
 To stop the execution of a thread, use the Abort method, as
shown in the following code.
newThread.Abort()
 Besides starting and stopping threads, you can also pause
threads by calling the Sleep or Suspend method, resume a
suspended thread by using the Resume method, and
destroy a thread by using the Abort method
THREAD METHODS:
METHOD ACTION
Start Causes a thread to start to run.
sleep Pauses a thread for a specified time
suspend Pauses a thread when it reaches a safe point.
abort Stops a thread when it reaches a safe point.
resume Restarts a suspended thread
join Causes the current thread to wait for another thread
to finish. If used with a time-out value, this method
returns True if the thread finishes in the allocated
THREAD PROPERTIES:
PROPERTY VALUE
IsAlive Contains the value True if a thread is active
IsBackground Gets or sets a Boolean that indicates if a thread is or should be a
background thread. Background threads are like foreground
threads, but a background thread does not prevent a process
from stopping. Once all foreground threads that belong to a
process have stopped, the common language runtime ends the
process by calling the Abort method on background threads
that are still alive.
CON…
Name Gets or sets the name of a thread.
Most frequently used to discover
individual threads when you
debug.
Priority Gets or sets a value that is used by the
operating system to prioritize thread
scheduling.
Thread state Contains a value that describes a
thread's state or states.
SETTING A THREAD’S PRIORITY
 Threads are scheduled for execution based on their
priority.
 Above normal-gives a thread higher priority.
 Below normal-gives a thread lower priority.
 Highest-gives a thread highest priority.
 Lowest-gives a thread lowest priority.
 Normal-gives a thread average priority.
DETERMINING THREAD STATE
 The thread state property gives you information about the
status of a thread.
 Initialized-the thread was initialized , but it hasn’t started.
 Ready- the thread is ready.
 Running-the thread is running.
 Standby-the thread is on standby.
 Terminated-the thread has terminated.
 Transition-the thread is in transition between two states.
 Unknown-the thread state is unknown.
 Wait-the thread is waiting.

More Related Content

What's hot

Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in javaArafat Hossan
 
Chap3 multi threaded programming
Chap3 multi threaded programmingChap3 multi threaded programming
Chap3 multi threaded programmingraksharao
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)Prakhar Maurya
 
Introduction to TPL
Introduction to TPLIntroduction to TPL
Introduction to TPLGyuwon Yi
 
Multithreaded programming
Multithreaded programmingMultithreaded programming
Multithreaded programmingSonam Sharma
 
Python session.11 By Shanmugam
Python session.11 By ShanmugamPython session.11 By Shanmugam
Python session.11 By ShanmugamNavaneethan Naveen
 
Java concurrency - Thread pools
Java concurrency - Thread poolsJava concurrency - Thread pools
Java concurrency - Thread poolsmaksym220889
 
Multithreading
MultithreadingMultithreading
MultithreadingA B Shinde
 
اسلاید ارائه اول جلسه ۱۰ کلاس پایتون برای هکر های قانونی
اسلاید ارائه اول جلسه ۱۰ کلاس پایتون برای هکر های قانونی اسلاید ارائه اول جلسه ۱۰ کلاس پایتون برای هکر های قانونی
اسلاید ارائه اول جلسه ۱۰ کلاس پایتون برای هکر های قانونی Mohammad Reza Kamalifard
 
Lecture 23-24.pptx
Lecture 23-24.pptxLecture 23-24.pptx
Lecture 23-24.pptxtalha ijaz
 
Getting to Know the Cassandra Codebase
Getting to Know the Cassandra CodebaseGetting to Know the Cassandra Codebase
Getting to Know the Cassandra Codebasegdusbabek
 

What's hot (20)

Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Multi-Threading
Multi-ThreadingMulti-Threading
Multi-Threading
 
Chap3 multi threaded programming
Chap3 multi threaded programmingChap3 multi threaded programming
Chap3 multi threaded programming
 
18 concurrency
18   concurrency18   concurrency
18 concurrency
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
Thread model in java
Thread model in javaThread model in java
Thread model in java
 
Thread
ThreadThread
Thread
 
Introduction to TPL
Introduction to TPLIntroduction to TPL
Introduction to TPL
 
Multithreaded programming
Multithreaded programmingMultithreaded programming
Multithreaded programming
 
Python session.11 By Shanmugam
Python session.11 By ShanmugamPython session.11 By Shanmugam
Python session.11 By Shanmugam
 
Multi threading
Multi threadingMulti threading
Multi threading
 
Thread 1
Thread 1Thread 1
Thread 1
 
Java concurrency - Thread pools
Java concurrency - Thread poolsJava concurrency - Thread pools
Java concurrency - Thread pools
 
Os
OsOs
Os
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Threads in java
Threads in javaThreads in java
Threads in java
 
اسلاید ارائه اول جلسه ۱۰ کلاس پایتون برای هکر های قانونی
اسلاید ارائه اول جلسه ۱۰ کلاس پایتون برای هکر های قانونی اسلاید ارائه اول جلسه ۱۰ کلاس پایتون برای هکر های قانونی
اسلاید ارائه اول جلسه ۱۰ کلاس پایتون برای هکر های قانونی
 
Multithreading.
Multithreading.Multithreading.
Multithreading.
 
Lecture 23-24.pptx
Lecture 23-24.pptxLecture 23-24.pptx
Lecture 23-24.pptx
 
Getting to Know the Cassandra Codebase
Getting to Know the Cassandra CodebaseGetting to Know the Cassandra Codebase
Getting to Know the Cassandra Codebase
 

Similar to Multithreading

Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in javaRaghu nath
 
9.multi-threading latest(MB).ppt .
9.multi-threading latest(MB).ppt            .9.multi-threading latest(MB).ppt            .
9.multi-threading latest(MB).ppt .happycocoman
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in javajunnubabu
 
Java Performance, Threading and Concurrent Data Structures
Java Performance, Threading and Concurrent Data StructuresJava Performance, Threading and Concurrent Data Structures
Java Performance, Threading and Concurrent Data StructuresHitendra Kumar
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in javaKavitha713564
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in javaKavitha713564
 
Multithreading
MultithreadingMultithreading
Multithreadingbackdoor
 
Thread priorities in java
Thread priorities in javaThread priorities in java
Thread priorities in javaDucat India
 
Multithreading Introduction and Lifecyle of thread
Multithreading Introduction and Lifecyle of threadMultithreading Introduction and Lifecyle of thread
Multithreading Introduction and Lifecyle of threadKartik Dube
 
Java Multithreading
Java MultithreadingJava Multithreading
Java MultithreadingRajkattamuri
 
Java multithreading
Java multithreadingJava multithreading
Java multithreadingMohammed625
 

Similar to Multithreading (20)

Md09 multithreading
Md09 multithreadingMd09 multithreading
Md09 multithreading
 
Threadnotes
ThreadnotesThreadnotes
Threadnotes
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
9.multi-threading latest(MB).ppt .
9.multi-threading latest(MB).ppt            .9.multi-threading latest(MB).ppt            .
9.multi-threading latest(MB).ppt .
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Chap2 2 1
Chap2 2 1Chap2 2 1
Chap2 2 1
 
Java Threads
Java ThreadsJava Threads
Java Threads
 
Threading.pptx
Threading.pptxThreading.pptx
Threading.pptx
 
Java Performance, Threading and Concurrent Data Structures
Java Performance, Threading and Concurrent Data StructuresJava Performance, Threading and Concurrent Data Structures
Java Performance, Threading and Concurrent Data Structures
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Threads
ThreadsThreads
Threads
 
Thread priorities in java
Thread priorities in javaThread priorities in java
Thread priorities in java
 
Multithreading Introduction and Lifecyle of thread
Multithreading Introduction and Lifecyle of threadMultithreading Introduction and Lifecyle of thread
Multithreading Introduction and Lifecyle of thread
 
Threading concepts
Threading conceptsThreading concepts
Threading concepts
 
Slide 7 Thread-1.pptx
Slide 7 Thread-1.pptxSlide 7 Thread-1.pptx
Slide 7 Thread-1.pptx
 
Java Multithreading
Java MultithreadingJava Multithreading
Java Multithreading
 
Java multithreading
Java multithreadingJava multithreading
Java multithreading
 

More from GowriLatha1

Filtering in frequency domain
Filtering in frequency domainFiltering in frequency domain
Filtering in frequency domainGowriLatha1
 
Demand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple accessDemand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple accessGowriLatha1
 
Software engineering
Software engineeringSoftware engineering
Software engineeringGowriLatha1
 
Web services & com+ components
Web services & com+ componentsWeb services & com+ components
Web services & com+ componentsGowriLatha1
 
Comparison with Traditional databases
Comparison with Traditional databasesComparison with Traditional databases
Comparison with Traditional databasesGowriLatha1
 
Comparison with Traditional databases
Comparison with Traditional databasesComparison with Traditional databases
Comparison with Traditional databasesGowriLatha1
 
Inter process communication
Inter process communicationInter process communication
Inter process communicationGowriLatha1
 
computer network
computer networkcomputer network
computer networkGowriLatha1
 
Operating System
Operating SystemOperating System
Operating SystemGowriLatha1
 
Data mining query language
Data mining query languageData mining query language
Data mining query languageGowriLatha1
 
Path & application(ds)2
Path & application(ds)2Path & application(ds)2
Path & application(ds)2GowriLatha1
 

More from GowriLatha1 (20)

Filtering in frequency domain
Filtering in frequency domainFiltering in frequency domain
Filtering in frequency domain
 
Demand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple accessDemand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple access
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Shadow paging
Shadow pagingShadow paging
Shadow paging
 
Hive
HiveHive
Hive
 
Web services & com+ components
Web services & com+ componentsWeb services & com+ components
Web services & com+ components
 
Comparison with Traditional databases
Comparison with Traditional databasesComparison with Traditional databases
Comparison with Traditional databases
 
Recovery system
Recovery systemRecovery system
Recovery system
 
Comparison with Traditional databases
Comparison with Traditional databasesComparison with Traditional databases
Comparison with Traditional databases
 
Static analysis
Static analysisStatic analysis
Static analysis
 
Hema dm
Hema dmHema dm
Hema dm
 
Data reduction
Data reductionData reduction
Data reduction
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
computer network
computer networkcomputer network
computer network
 
Operating System
Operating SystemOperating System
Operating System
 
Data mining query language
Data mining query languageData mining query language
Data mining query language
 
Enterprice java
Enterprice javaEnterprice java
Enterprice java
 
Ethernet
EthernetEthernet
Ethernet
 
Java script
Java scriptJava script
Java script
 
Path & application(ds)2
Path & application(ds)2Path & application(ds)2
Path & application(ds)2
 

Recently uploaded

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 

Recently uploaded (20)

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 

Multithreading

  • 2. INTRODUCTION:  Multithreading enables your Visual Basic program to perform concurrent processing so that you can do more than one operation at a time happening is that is divided by the computer into slices, and start a new thread ,that thread gets some time slices which means that threads code can execute.  Visual Basic program to perform concurrent processing so that you can do more than one operation at a time.
  • 3. THREAD PROPERTIES:  Threads enable your program to perform concurrent processing.  The .NET Framework System. Threading namespace makes using threads easier.  Threads share the application's resources. For more information, see Using Threads and Threading.
  • 4. CREATING A THREAD:  create a new thread by declaring a variable of type Thread and calling the constructor, providing the name of the procedure or method that you want to execute on the new thread. Dim newThread As New System.Threading.Thread(AddressOf AMethod)
  • 5. STARTING A THREAD:  To start the execution of a new thread, use the Start method, as shown in the following code newThread.Start()
  • 6. STOPPING A THREAD  To stop the execution of a thread, use the Abort method, as shown in the following code. newThread.Abort()  Besides starting and stopping threads, you can also pause threads by calling the Sleep or Suspend method, resume a suspended thread by using the Resume method, and destroy a thread by using the Abort method
  • 7. THREAD METHODS: METHOD ACTION Start Causes a thread to start to run. sleep Pauses a thread for a specified time suspend Pauses a thread when it reaches a safe point. abort Stops a thread when it reaches a safe point. resume Restarts a suspended thread join Causes the current thread to wait for another thread to finish. If used with a time-out value, this method returns True if the thread finishes in the allocated
  • 8. THREAD PROPERTIES: PROPERTY VALUE IsAlive Contains the value True if a thread is active IsBackground Gets or sets a Boolean that indicates if a thread is or should be a background thread. Background threads are like foreground threads, but a background thread does not prevent a process from stopping. Once all foreground threads that belong to a process have stopped, the common language runtime ends the process by calling the Abort method on background threads that are still alive.
  • 9. CON… Name Gets or sets the name of a thread. Most frequently used to discover individual threads when you debug. Priority Gets or sets a value that is used by the operating system to prioritize thread scheduling. Thread state Contains a value that describes a thread's state or states.
  • 10. SETTING A THREAD’S PRIORITY  Threads are scheduled for execution based on their priority.  Above normal-gives a thread higher priority.  Below normal-gives a thread lower priority.  Highest-gives a thread highest priority.  Lowest-gives a thread lowest priority.  Normal-gives a thread average priority.
  • 11. DETERMINING THREAD STATE  The thread state property gives you information about the status of a thread.  Initialized-the thread was initialized , but it hasn’t started.  Ready- the thread is ready.  Running-the thread is running.  Standby-the thread is on standby.  Terminated-the thread has terminated.  Transition-the thread is in transition between two states.  Unknown-the thread state is unknown.  Wait-the thread is waiting.