[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: a question about tst-cancel2



Actually, the spec says write() is a cancelation point.  Here is the list of
the cancelation points:

accept( )
2262 aio_suspend( )
2263 clock_nanosleep( )
2264 close( )
2265 connect( )
2266 creat( )
2267 fcntl( )2
2268 fsync( )
2269 getmsg( )
2270 getpmsg( )
2271 lockf( )
2272 mq_receive( )
2273 mq_send( )
2274 mq_timedreceive( )
mq_timedsend( )
msgrcv( )
msgsnd( )
msync( )
nanosleep( )
open( )
pause( )
poll( )
pread( )
pthread_cond_timedwait( )
pthread_cond_wait( )
pthread_join( )
pthread_testcancel( )
putmsg( )
putpmsg( )
pwrite( )
read( )
readv( )
recv( )
recvfrom( )
recvmsg( )
select( )
sem_timedwait( )
sem_wait( )
send( )
sendmsg( )
sendto( )
sigpause( )
sigsuspend( )
sigtimedwait( )
sigwait( )
sigwaitinfo ( )
sleep( )
system( )
tcdrain( )
usleep( )
wait( )
waitid( )
waitpid( )
write( )
writev( )


Rolla


* my views are not necessarily my employer's *


-----Original Message-----
From: Hu, Boris [mailto:boris hu intel com]
Sent: Tuesday, April 01, 2003 7:08 PM
To: Saurabh Desai
Cc: NPTL list (E-mail)
Subject: RE: a question about tst-cancel2


write() is a cancellation point ? 

man pthread_cancel(),  I could get the following line.

The following POSIX threads functions  are
cancellation points:
       pthread_join(3)
       pthread_cond_wait(3)
       pthread_cond_timedwait(3)
       pthread_testcancel(3)
       sem_wait(3)
       sigwait(3)
 All  other  POSIX threads functions are guaranteed not to be 
cancellation points. That is, they never perform cancellation 
in deferred cancellation mode.

By the way, I traced the pthread_cancel() in tst-cancel2. 
It only masked the pd->cancelhandling |= CANCELED_BITMASK,
instead of sending SIGCANCEL signal to the child thread. 

Do I miss sth? thanks. 

boris


> -----Original Message-----
> From: Saurabh Desai [mailto:sdesai austin ibm com]
> Sent: 2003?4?2? 1:18
> To: Hu, Boris
> Cc: NPTL list (E-mail)
> Subject: Re: a question about tst-cancel2
> 
> 
> "Hu, Boris" wrote:
> > 
> > thanks for your reply.  :)
> > 
> > yeah, pthread_testcancel() is a point to execute cancel buffer
> > code. But in tst-cancel2, there is no place to call
> > pthread_testcancel().  :(  So there must be another place
> > to call __do_cancel().
> > 
> > I have checked all places to call __do_cancel(),
> > init.c::sigcancel_handler()
> > _pthread_cleanup_pop_restore()
> > pthread_testcancel()
> > pthread_enable_asynccancel()
> > pthread_enable_asynccancel_2()
> > __libc_enable_asynccancel()
> > pthread_exit()
> > pthread_setcancelstate()
> > pthread_setcanceltype()
> > 
> > but I failed to find the tst-cancel2 to run one of them. :(
> > 
> In this case, it will run from sigcancel_handler(). Here the write()
> is a cancellation point and enables async-cancellation before it waits
> in kernel. The pthread_cancel sends SIGCANCEL signal and this
> handler gets called, which then calls __do_cancel.
> 
> - Saurabh
> 



-- 
Phil-list mailing list
Phil-list redhat com
https://listman.redhat.com/mailman/listinfo/phil-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]