• 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: call scrollRangeToVisible in multi-threads cause application dead lock
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: call scrollRangeToVisible in multi-threads cause application dead lock


  • Subject: Re: call scrollRangeToVisible in multi-threads cause application dead lock
  • From: "Shawn Erickson" <email@hidden>
  • Date: Wed, 7 Mar 2007 09:42:39 -0800

On 3/7/07, David Gish <email@hidden> wrote:
> Apple states that the AppKit is generally NOT thread safe.  Why on
> earth would you think that having critical section in YOUR code
> would magically make the AppKit thread safe.  Until or unless Apple
> makes the AppKit thread safe, you are out of luck and there is no
> way you can correctly call AppKit methods directly from multiple-
> threads.

It is certainly possible to call non-thread safe code in a threaded
environment with critical sections in your code.

Only if all parties involved participate in the same critical section constructs... which in this case he has the system pumping events, etc. into a runloop in the main thread and none of that code knows anything about his critical sections.

For example, the C++ STL (Standard Template Library) isn't
thread-safe, but as long as you know that, you prevent simultaneous
access to STL objects in YOUR code.

Right but his ("your") code isn't the only thing involved here...

-Shawn
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: call scrollRangeToVisible in multi-threads cause application dead lock
      • From: 王 庆 <email@hidden>
References: 
 >Re: call scrollRangeToVisible in multi-threads cause application dead lock (From: Erik Buck <email@hidden>)
 >Re: call scrollRangeToVisible in multi-threads cause application dead lock (From: David Gish <email@hidden>)

  • Prev by Date: Re: Problems launching tool from within application
  • Next by Date: Re: "exponent" action in NSTextView subclass (SOLVED)
  • Previous by thread: Re: call scrollRangeToVisible in multi-threads cause application dead lock
  • Next by thread: Re: call scrollRangeToVisible in multi-threads cause application dead lock
  • Index(es):
    • Date
    • Thread