Home » U++ Library support » U++ MT-multithreading and servers » how to stop a thread that is waiting, e.g., listen()
Re: how to stop a thread that is waiting, e.g., listen() [message #11803 is a reply to message #11802] |
Wed, 26 September 2007 13:05 |
|
tvanriper
Messages: 85 Registered: September 2007 Location: Germantown, MD, USA
|
Member |
|
|
You could probably do this with a signal. Normally, threads allow you to have multiple signals at one time. You are using one of those signals right now to wait on your networking socket (or whatever you're doing)... so you could create another signal to indicate that you have some kind of message for the thread.
The message could be stored in a variable that's protected by a mutex.
When the thread gets the signal, it looks in the variable, sees that you want it to close, and then stops itself (cleaning up any variables it needs to clean up).
It's not recommended to try and forcibly close a thread, as you seem to suggest wanting to do, because this will not deallocate variables you have (implicitly or explicitly) allocated for that thread.
|
|
|
|
|
how to stop a thread that is waiting, e.g., listen()
By: bonami on Wed, 26 September 2007 11:40
|
|
|
Re: how to stop a thread that is waiting, e.g., listen()
By: tvanriper on Wed, 26 September 2007 13:05
|
|
|
Re: how to stop a thread that is waiting, e.g., listen()
By: bonami on Thu, 27 September 2007 10:57
|
|
|
Re: how to stop a thread that is waiting, e.g., listen()
By: tvanriper on Thu, 27 September 2007 13:20
|
|
|
Re: how to stop a thread that is waiting, e.g., listen()
By: tvanriper on Thu, 27 September 2007 13:43
|
|
|
Re: how to stop a thread that is waiting, e.g., listen()
By: bonami on Fri, 28 September 2007 05:13
|
|
|
Re: how to stop a thread that is waiting, e.g., listen()
By: tvanriper on Sat, 29 September 2007 14:46
|
|
|
Re: how to stop a thread that is waiting, e.g., listen()
By: bonami on Tue, 16 October 2007 11:59
|
|
|
Re: how to stop a thread that is waiting, e.g., listen()
By: mirek on Wed, 17 October 2007 19:16
|
|
|
Re: how to stop a thread that is waiting, e.g., listen()
By: bonami on Fri, 19 October 2007 11:52
|
|
|
Re: how to stop a thread that is waiting, e.g., listen()
|
|
|
Re: how to stop a thread that is waiting, e.g., listen()
By: bonami on Mon, 22 October 2007 11:47
|
|
|
Re: how to stop a thread that is waiting, e.g., listen()
|
|
|
Re: how to stop a thread that is waiting, e.g., listen()
By: bonami on Wed, 24 October 2007 04:20
|
|
|
Re: how to stop a thread that is waiting, e.g., listen()
By: mirek on Sun, 11 November 2007 18:49
|
|
|
Re: how to stop a thread that is waiting, e.g., listen()
By: bonami on Mon, 12 November 2007 02:19
|
Goto Forum:
Current Time: Tue May 14 07:45:56 CEST 2024
Total time taken to generate the page: 0.02713 seconds
|