• 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: Allocation in Pools and threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Allocation in Pools and threads


  • Subject: Re: Allocation in Pools and threads
  • From: Greg Hulands <email@hidden>
  • Date: Tue, 15 Jun 2004 13:33:40 +1000

On 15/06/2004, at 1:19 PM, Ken Tozier wrote:

Is it necessary to always create a new NSAutoreleasePool in detached threads?

Yes. You will get a heap of _NSNoAutoreleasePool or something like that in the log if you don't create a pool.

And if so, what happens to objects allocated between the creation and disposal of the pool?

Those objects that have been asked to be autorelease or released, will be deallocated at this time. Those that have not, will still be available in memory.


The reason I ask is that I have a class that spawns a thread in one of it's more time consuming methods but I want the method to write it's results to an instance variable of the class when it's done doing it's thing. Won't the data the method writes to the instance variable get zapped when I release the pool?

Have you tried? It shouldn't do it.

Greg



Thanks

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


References: 
 >Allocation in Pools and threads (From: Ken Tozier <email@hidden>)

  • Prev by Date: Allocation in Pools and threads
  • Next by Date: Re: Image Alignment In Scrolled View?
  • Previous by thread: Allocation in Pools and threads
  • Next by thread: Re: Allocation in Pools and threads
  • Index(es):
    • Date
    • Thread