• 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: Thread not registered mystery under GC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thread not registered mystery under GC


  • Subject: Re: Thread not registered mystery under GC
  • From: "Sean McBride" <email@hidden>
  • Date: Wed, 27 Oct 2010 11:57:55 -0400
  • Organization: Rogue Research Inc.

On Tue, 26 Oct 2010 13:22:35 -0700, Greg Parker said:

>> Registering/unregistering a thread on the fly isn't really something
>that is supported well.   I.e. once a thread goes GC, it really should
>stay that way.
>
>To clarify: do not call objc_unregisterThreadWithCollector(). The thread
>will be unregistered automatically when it completes.
>
>You can use register+unregister to move a thread in and out of GC, but
>that has subtle pitfalls and is not recommended. (For example, if you
>explicitly call unregister but some other framework code set up a
>pthread thread-specific destructor that expects to run on a GC thread,
>you could crash.)

Thanks Greg and Bill for clarifying the usage of these APIs!  The
symmetry of the function's names betrays correct usage. :(  It's a
little weird that we are expected to register but not expected to
unregister; but no matter. It sure would be nice if such nuggets were
documented, at least in the .h if not in Xcode's doc viewer.

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Thread not registered mystery under GC (From: Andy O'Meara <email@hidden>)
 >Re: Thread not registered mystery under GC (From: Bill Bumgarner <email@hidden>)
 >Re: Thread not registered mystery under GC (From: "Sean McBride" <email@hidden>)
 >Re: Thread not registered mystery under GC (From: Bill Bumgarner <email@hidden>)
 >Re: Thread not registered mystery under GC (From: Greg Parker <email@hidden>)

  • Prev by Date: Re: NSFileManager and Resource Forks
  • Next by Date: How to translate the app display name in iPhone
  • Previous by thread: Re: Thread not registered mystery under GC
  • Next by thread: Re: Thread not registered mystery under GC
  • Index(es):
    • Date
    • Thread