• 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: NSTableDataSources and multi-threading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableDataSources and multi-threading


  • Subject: Re: NSTableDataSources and multi-threading
  • From: Nick Zitzmann <email@hidden>
  • Date: Tue, 4 Nov 2003 20:43:42 -0800

On Nov 4, 2003, at 12:11 AM, Sean Gilbertson wrote:

I have a data source, whose represented data is updated by several threads. Because of this, the result of numberOfRowsInTableView: may not be valid by the time tableView:objectValueForTableColumn:row: is called. I have tried several ways of making sure that this does not occur, including subclassing NSTableView and notifying the data source when reloadData is called, but of course that is not the appropriate place to look for redrawing of the table view; it is an auxiliary method. Of course, I am using locks, but they are almost worthless unless I can actually guarantee incorrupt output.

The way I fixed this with one project was to add a lock object, use PB's Find window to point out each place in the code that the data source was being accessed, and then add balancing lock and unlock calls to each place. It's pretty much the only way to do what you want to do...

Nick Zitzmann
AIM/iChat: dragonsdontsleep
Check out my software page: http://seiryu.home.comcast.net/
S/MIME signature available upon request

"I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone." - Bjarne Stroustrup
_______________________________________________
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.
  • Follow-Ups:
    • Re: NSTableDataSources and multi-threading
      • From: Shawn Erickson <email@hidden>
References: 
 >NSTableDataSources and multi-threading (From: Sean Gilbertson <email@hidden>)

  • Prev by Date: Re: unsigned 16 digit integer data type?
  • Next by Date: Re: Notification error
  • Previous by thread: NSTableDataSources and multi-threading
  • Next by thread: Re: NSTableDataSources and multi-threading
  • Index(es):
    • Date
    • Thread