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_cancel and C++ destructors



Hi,

> 2. read() cannot be made to return by interruption with a signal,
> although the man pages suggests a return code for that condition. (I
> was sending a SIGALRM with my own handler installed — is there a
> particular signal I need to send, perhaps without installing my own
> handler?)

Honestly it sounds like you'd be better of working on a different level of
abstraction.  iostream really isn't designed for stuff like this.  And at
the other level you can avoid a lot of these issues.

Someone already mentioned but you need to check that SA_RESTART is off if
you want read() not to resume; that might get the EINTR to propagate. 
However that might just get you into another swamp with std::iostream, but
well, if that's your choice of technology, ...

> 5. I'm basically recreating the asynchronous cancel type.... because
> it's apparently not supported at all on OS X (even ignores explicit
> pthread_testcancel calls, much less exit from busy loop!)

This might be suggesting that you might want to consider a design that
simply does not require this feature.  Your description sounds like these
features just are not mature enough for real production use yet?

Lassi
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden

References: 
 >pthread_cancel and C++ destructors (From: Ethan Tira-Thompson <email@hidden>)
 >Re: pthread_cancel and C++ destructors (From: Ethan Tira-Thompson <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.