K
Keith Langer
I have an application which consists of a main work thread and
multiple threads which each maintain a TCP socket.
When a configuration change occurs, all activity on the socket threads
must be halted. If a socket is no longer in the configuration, that
thread must be aborted and the socket must be closed. After the
configuration is complete, the remaining threads must be resumed.
I currently have the following architecture:
1) Suspend all threads
2) Abort threads which are no longer required and close their sockets
3) Resume all remaining threads.
If I suspend a thread and then abort it, CPU usage jumps to 100%. I
must first resume the thread and then abort it. This doesn't seem
right, so I'm wondering if I'm missing something here.
I also found in MSDN that Microsoft does not recommend using these
methods. If that's the case, then what is the proper technique?
thanks,
Keith
multiple threads which each maintain a TCP socket.
When a configuration change occurs, all activity on the socket threads
must be halted. If a socket is no longer in the configuration, that
thread must be aborted and the socket must be closed. After the
configuration is complete, the remaining threads must be resumed.
I currently have the following architecture:
1) Suspend all threads
2) Abort threads which are no longer required and close their sockets
3) Resume all remaining threads.
If I suspend a thread and then abort it, CPU usage jumps to 100%. I
must first resume the thread and then abort it. This doesn't seem
right, so I'm wondering if I'm missing something here.
I also found in MSDN that Microsoft does not recommend using these
methods. If that's the case, then what is the proper technique?
thanks,
Keith