• 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: Quandary : NSAppleScript ties up main thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quandary : NSAppleScript ties up main thread


  • Subject: Re: Quandary : NSAppleScript ties up main thread
  • From: Shane Stanley <email@hidden>
  • Date: Tue, 11 Oct 2011 13:01:52 +1100

On 11/10/2011, at 10:41 AM, Jerry Krinock wrote:

> However, any invocation to NSAppleScript must occur on the main thread

From the 10.6 release notes:

> Thread Safety
> OSA and AppleScript are now thread-safe: they may be safely called on a non-main thread or from multiple threads without any locking in the client code. This also applies toNSAppleScript. This does not mean that AppleScript is totally concurrent: AppleScript uses locking to ensure that any single connection (a ComponentInstance) will only run on one thread at a time. Because of the size of the locking granularity, trying to manipulate the same script from multiple threads at once may still be subject to race conditions, and is not recommended.
>
> Before using a scripting component on a background thread, developers should test the component’s “thread-safe” bit (cmpThreadSafe in the ComponentDescription’scomponentFlags.) Test the generic component before using OSA on a background thread, and then test the specific language component before using it on a background thread.


--
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>

_______________________________________________

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

  • Follow-Ups:
    • Re: Quandary : NSAppleScript ties up main thread
      • From: Jerry Krinock <email@hidden>
References: 
 >Quandary : NSAppleScript ties up main thread (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: How to get info about an iOS device (UDID, etc)?
  • Next by Date: Re: drawRect not being called by NSCollectionView..
  • Previous by thread: Re: Quandary : NSAppleScript ties up main thread
  • Next by thread: Re: Quandary : NSAppleScript ties up main thread
  • Index(es):
    • Date
    • Thread