problem with pthread_cancel

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
 
K

Kenny McCormack

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.

Off topic. Not portable. Cant discuss it here. Blah, blah, blah.

--
Useful clc-related links:

http://en.wikipedia.org/wiki/Aspergers
http://en.wikipedia.org/wiki/Clique
http://en.wikipedia.org/wiki/C_programming_language
 
K

Keith Thompson

vamsi said:
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.
[snip]

Try asking in comp.progrmaming.threads.
 
K

Keith Thompson

Keith Thompson said:
vamsi said:
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.
[snip]

Try asking in comp.progrmaming.threads.

Sorry for the typo, that's comp.programming.threads.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,919
Members
47,458
Latest member
Chris#

Latest Threads

Top