- SOME COMMONLY USED METHODS FOR HANDLING THREADS
- ABORT (): With this method after calling, the thread will turn to the steady-state and returns the attribute value ThreadState Stopped.
- SUSPEND (): Thread is running if the method calls Suspend () then it will stop operating until called back by the Resume method ().
- SLEEP (): When a thread is running if Sleep is called then it will fall into the standby status for the period t (in milliseconds) then will continue to operate. For example: “System.Threading.Thread.Sleep (1000);”. When this method is called, the thread will pause for 1000 milliseconds. I see this is a static method that can be called without any thread through an instance.
- JOIN (): This is a method I found very commonly used when handling threads. We can understand the meaning of this method as follows: When a thread calls the Join the thread that will be given a priority in the system. The Join method intends that it is to be executed only when the ribbon ends. The command had run since before it was implemented with the current thread and did not affect anything.
- FOR EXAMPLE, THE JOIN METHOD IN THREAD
This example is similar to the example above, except that: Thread t1, t2 calls the Join method before t3 Thread Start (). For this reason, t1 and t2 will be dealt with until the end of the t3 2 begin implementation. Looking at the results, it is easy to see the “return:”. The character “+”, “-” in turn 2 until the end of nature “o” is in the beginning.