Re: call scrollRangeToVisible in multi-threads cause application dead lock
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