From: ssundaragopalan@hss.hns.com
To: pankaj bathwal <pbathwal@yahoo.com>
Cc: pthreads-win32@sources.redhat.com
Subject: Re: pthread_cancel doesn't work
Date: Sat, 16 Nov 2002 08:24:00 -0000 [thread overview]
Message-ID: <65256C73.0059DCB4.00@sampark.hss.hns.com> (raw)
Hi pankaj,
In Windows, threads get cancelled only in CANCELLATION POINTS.
So you *cannot* expect your thread to get cancelled as soon as you cancel
the thread
by calling pthread_cancel. So,unless it comes across a cancellation point
it wont get cancelled.
I suggest you to do a explicit pthread_testcancel() in your thread which is
a defined cancelleation point
and the thread will relinquish when it encounters this.
some possible scenarios where a thread might not get cancelled are
> Listening in a socket
> waiting for a user input from console(getchar())
regds,
srikanth
pankaj bathwal <pbathwal@yahoo.com> on 11/16/2002 11:17:31 AM
To: pthreads-win32@sources.redhat.com
cc: (bcc: Srikanth Sundaragopalan/HSSBLR)
Subject: pthread_cancel doesn't work
Hi,
I am trying to cancel a running thread.
I an using "pthread_cancel" function.
I have set cancel state as PTHREAD_CANCEL_ENABLE using
function "pthread_setcancelstate" but execution of my
thread does not stop.
what's wrong??
Do I have to something more??
Can I have a sample code??
Thanks
Pankaj
__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com
next reply other threads:[~2002-11-16 16:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-16 8:24 ssundaragopalan [this message]
2002-11-17 22:26 ` pankaj bathwal
-- strict thread matches above, loose matches on Subject: below --
2002-11-16 3:17 pankaj bathwal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=65256C73.0059DCB4.00@sampark.hss.hns.com \
--to=ssundaragopalan@hss.hns.com \
--cc=pbathwal@yahoo.com \
--cc=pthreads-win32@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).