From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21716 invoked by alias); 18 Nov 2002 06:26:19 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 21708 invoked from network); 18 Nov 2002 06:26:16 -0000 Received: from unknown (HELO web41110.mail.yahoo.com) (66.218.93.26) by sources.redhat.com with SMTP; 18 Nov 2002 06:26:16 -0000 Message-ID: <20021118062616.37758.qmail@web41110.mail.yahoo.com> Received: from [202.131.158.89] by web41110.mail.yahoo.com via HTTP; Sun, 17 Nov 2002 22:26:16 PST Date: Sun, 17 Nov 2002 22:26:00 -0000 From: pankaj bathwal Subject: Re: pthread_cancel doesn't work To: ssundaragopalan@hss.hns.com Cc: pthreads-win32@sources.redhat.com In-Reply-To: <65256C73.0059DCB4.00@sampark.hss.hns.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002/txt/msg00113.txt.bz2 Thanks Srikanth Are there any system define cancellation points like sleep, pthread_cond_wait, read, write etc When did thread actually get cancelled??? When a running thread encounter a cancellation point after pthread_cancel is called??? Or if a thread gets cancel when we are in system a system define canecllation point?? Thanks again.... Regards Pankaj --- ssundaragopalan@hss.hns.com wrote: > > > 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 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 > > > > __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - Let the expert host your site http://webhosting.yahoo.com