Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PTHREAD_CANCELED



On Feb 27, 2004, at 4:35 AM, Daniel Oberhoff wrote:

since this must have missed attention in the last mail, is there any meaning in the fact that PTHREAD_CANCELED is not defined in pthread? the man page still states it as the indicator of cancellation of the thread after pthread_cancel ().

pthread cancellation isn't really implemented in Darwin. Check out pthread_cancel() in <http://cvs.opendarwin.org/index.cgi/Libc/pthreads/pthread.c? rev=1.1.1.1&content-type=text/x-cvsweb-markup&cvsroot=apple> - it just sets a flag; it doesn't deliver a signal or anything, as would be necessary to immediately wake it from a blocking call or during async cancellation.

(I did see a message in the archives of this list that they have a more complete implementation of cancellation but are holding off because many frameworks are not cancel-safe. So it exists, but it's not available, and with good reason if you're using those frameworks...)

Also, as obviously lacking as the Darwin implementation is, I've found it doesn't really work well anywhere else, either. I've got a bunch of tests at <http://www.slamb.org/svn/repos/projects/cancellation_tests/ index.html>, and my conclusion is that cancellation is not worth using and won't be for some time.

So, I'm afraid you'll need to find another way of doing what you want. Sorry.

Scott
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.


References: 
 >PTHREAD_CANCELED (From: Daniel Oberhoff <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.