• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: pthread_cancel and C++ destructors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pthread_cancel and C++ destructors


  • Subject: Re: pthread_cancel and C++ destructors
  • From: "Lassi Tuura" <email@hidden>
  • Date: Fri, 30 Nov 2007 10:26:50 +0100 (CET)
  • Importance: Normal

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:

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>)

  • Prev by Date: Re: Leo prebinding...
  • Next by Date: Re: Resident Memory, Private Memory, Shared Memory (top, Activity Monitor and vmmap)
  • Previous by thread: Re: pthread_cancel and C++ destructors
  • Next by thread: Crash in loader due to bad initialization functions pointers
  • Index(es):
    • Date
    • Thread