V
vamsi
Hi,
I have an application where it creates 32 threads. Later in the
logic, it has to kill some 10 threads. All the 10 threads does a
recvfrom on a unique socket in a while loop.
To cancel the thread, pthread_cancel API is used to send a cancel
signal to the target thread. All the threads are initialized as
canceltype - asynchronous. The pthread_cancel API sends signal to 8
threads succesfully, however for the 9th thread the pthread_cancel
fails with an error number 11 (EAGAIN).
I tried to send pthread_cancel in a while loop, stil the API fails
with the same error number. Does anyone have any suggestion, how to
proceed on this ?
Unfortunately, the exact code cannot be shared.
Regards,
Vamsi
I have an application where it creates 32 threads. Later in the
logic, it has to kill some 10 threads. All the 10 threads does a
recvfrom on a unique socket in a while loop.
To cancel the thread, pthread_cancel API is used to send a cancel
signal to the target thread. All the threads are initialized as
canceltype - asynchronous. The pthread_cancel API sends signal to 8
threads succesfully, however for the 9th thread the pthread_cancel
fails with an error number 11 (EAGAIN).
I tried to send pthread_cancel in a while loop, stil the API fails
with the same error number. Does anyone have any suggestion, how to
proceed on this ?
Unfortunately, the exact code cannot be shared.
Regards,
Vamsi