• 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: Messages between Threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Messages between Threads


  • Subject: Re: Messages between Threads
  • From: Michael Ash <email@hidden>
  • Date: Mon, 16 Mar 2009 10:35:26 -0400

On Mon, Mar 16, 2009 at 1:43 AM, Gerriet M. Denkmann
<email@hidden> wrote:
>
> On 15 Mar 2009, at 15:43, Joar Wingfors <email@hidden> wrote:
>>
>> On 15 mar 2009, at 01.14, Paul Sanders wrote:
>>
>>> I was referring to where the OP said:
>>>
>>>> "but would it be safe, given the fact that sum and count are bound
>>>> to some textFields / progressIndicator"
>>>>
>>> And presumably it would not be as the instance variables referred to
>>> were being mutated in a secondary thread.
>>
>>
>> That's right. If you've established bindings to some property of an
>> object, it's no longer OK to update that property from background
>> threads.
>>
>> Please refer to the Cocoa thread safety documentations:
>>
>>
>> <http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/Introduction/Introduction.html
>
> Could you please point to the exact section where it is stated that it is
> not OK to update a bound property from a background thread?

It's a consequence of several distinct facts:

1) It is not safe to update a control from a background thread.

2) Bound controls update when KVO notifications fire for the property
in question.

3) KVO notifications fire synchronously on whatever thread is updating
the property.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Messages between Threads (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: case-insensitive NSDictionary
  • Next by Date: Re: Type Declaration With Protocol
  • Previous by thread: Re: Messages between Threads
  • Next by thread: HTTP response using CFHTTPMessageCreateEmpty/CFHTTPMessageAppendBytes
  • Index(es):
    • Date
    • Thread