• 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: multithreading textviews
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multithreading textviews


  • Subject: Re: multithreading textviews
  • From: Cornelius <email@hidden>
  • Date: Thu, 22 Nov 2001 13:57:04 +0100

Thank you John and Drew

I will go through NSThread and NSAutoReleasePool and of course the java bridge

The solution beckons just beyond the horizon.

Cornelius


On Donnerstag, November 22, 2001, at 10:37 Uhr, John C. Randolph wrote:


On Thursday, November 22, 2001, at 12:40 AM, Drew McCormack wrote:

In Cocoa/Obj-C, an NSAutoReleasePool does the garbage collecting (to use your native java terminology). It updates the retain count (reference count) of each object which has been 'autoreleased' in the past event loop iteration. If the count hits zero, the object is deallocated. The thing you need to realize is that each thread needs to have its own autorelease pool.

This isn't quite accurate. Objects keep their own retain count, whether or not there's an autorelease pool in place. The autorelease pool is nothing more than a means to queue up -release messages that will be sent whenever the pool is released.

Each thread needs its own autorelease pool *if* anything in that thread is going to call -autorelease. This isn't always the case: for example, you might spawn a thread that runs a straight C function that doesn't make use of any Foundation Kit classes.

-jcr

"This is not a book to be tossed aside lightly. Rather, it should be hurled with great force." -Dorothy Parker


References: 
 >Re: multithreading textviews (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Re: Contextual Menus for an NSOutlineView
  • Next by Date: Re: Toolbar Icons area 32x32
  • Previous by thread: Re: multithreading textviews
  • Next by thread: Re: What does P2-->P3 mean ?
  • Index(es):
    • Date
    • Thread