Re: (Part 1) Thread-safety Concerns
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.