• 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: (Part 1) Thread-safety Concerns
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (Part 1) Thread-safety Concerns


  • Subject: Re: (Part 1) Thread-safety Concerns
  • From: Chris Hanson <email@hidden>
  • Date: Sun, 3 Nov 2002 02:53:59 -0600

Steve:

I think I've figured out what's going on from some of your concerns. You're talking about things like bringing up sheets from within network threads, manipulating table views etc. To me, this indicates that your application isn't fully MVC.

You should only be manipulating your interface from within your main thread; your data model can be manipulated from any of your threads (with appropriate synchronization). When your model is updated, you should notify your main thread, which can in turn update your interface to reflect the model. Nice and easy.

NSNotificationCenter won't work for this; notifications are delivered in the thread within which they're posted. But I'm sure you can come up with a mechanism such as a shared queue or NSDistributedNotificationCenter.

-- Chris

--
Chris Hanson | Email: email@hidden
bDistributed.com, Inc. | Phone: +1-847-372-3955
Making Business Distributed | Fax: +1-847-589-3738
http://bdistributed.com/ | Personal Email: email@hidden
_______________________________________________
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:
    • Crashing in NSUIHeartBeat thread
      • From: Paul Ferguson <email@hidden>
References: 
 >(Part 1) Thread-safety Concerns (From: Steve Klingsporn <email@hidden>)

  • Prev by Date: advice on filtering TreeNode objects
  • Next by Date: Plug-In strategy in Mach-O / Cocoa?
  • Previous by thread: (Part 1) Thread-safety Concerns
  • Next by thread: Crashing in NSUIHeartBeat thread
  • Index(es):
    • Date
    • Thread