flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
JohnFound
Actually you don't have to call TerminateThread always. If the thread ends normally, there is no reason to call TerminateThread.
You should use WaitForSingleObject only when you have to wait for thread to finish it's job. For example, if the main thread can't continue without the result of the thread. If you wait always it is useless to use thread - you can do the job in the main thread, instead of waiting. |
|||
![]() |
|
revolution
JohnFound wrote: For example, if the main thread can't continue without the result of the thread. If you wait always it is useless to use thread - you can do the job in the main thread, instead of waiting. |
|||
![]() |
|
ouadji
Quote:
Here is a sentence that perfectly explains the usefulness of this function. perfect, I understood. Thank you very much JohnFound Quote:
I also understand that. thank you revolution. (there is no synchronization in my case) |
|||
![]() |
|
b1528932
when you create thread, you must take responsibility for it, by for example registering waitforsingleobject. Thread that created child thread must be notyfied when it exitted (was killed?). You shouldnt just spawn thread and forget about it, hoping it will complete a job. When you write multithreaded app, 1 thread is always main thread wich only watch over its children and manage them,
|
|||
![]() |
|
Igor1024
Actually, "TerminateThread" function is rather bad for using, cause it can lead to leaks (read Jeffrey Richter ).
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.