• 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: Newbie: Object life within a method scope
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie: Object life within a method scope


  • Subject: Re: Newbie: Object life within a method scope
  • From: Joseph Feld <email@hidden>
  • Date: Wed, 23 Feb 2005 10:39:55 -0500

on 2/23/05 2:37 AM, Kevin Viggers at email@hidden wrote:

> Hi Joe,
>
> Have a read over the NSAutoreleasePool documentation as well. It might
> be helpful for you to get a feel for how the mechanism works, so that
> you see that there really isn't anything magically going on. The
> important point in regard to your question is that (in your typical
> mono-thread app) any actual work a NSAutoreleasePool does towards
> releasing objects happens in the *same* thread of execution as your
> method. Intuitively this means that even if your method receives as
> argument some object slated for reclamation, you can be confident that
> the object will not be de-allocated while your code controls the
> thread.
>
> It would seem that your Java conditioning is steering you towards the
> idea that objects are reclaimed by a separate thread (akin to the GC
> thread in Java) and that objects could potentially be pulled out from
> under your code, but this is typically not the case. It is only when an
> object is shared between threads that this becomes a true concern.

I think you hit the nail on the head, Kevin.  I was just assuming without
thinking about it that the actual object cleanup was happening in another
thread once my objects signaled their readiness to be cleaned.
Java-thinking, I know :-)

Thanks all for the replies, especially the documentation pointers (StepWise
looks like a great resource).

Joe


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Newbie: Object life within a method scope
      • From: Shawn Erickson <email@hidden>
References: 
 >Re: Newbie: Object life within a method scope (From: Kevin Viggers <email@hidden>)

  • Prev by Date: Re: Why is copyWithZone: being called?
  • Next by Date: Re: Indexing/Directory Enumeration
  • Previous by thread: Re: Newbie: Object life within a method scope
  • Next by thread: Re: Newbie: Object life within a method scope
  • Index(es):
    • Date
    • Thread