• 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: GCD and blocks cross development
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GCD and blocks cross development


  • Subject: Re: GCD and blocks cross development
  • From: "email@hidden" <email@hidden>
  • Date: Thu, 10 Sep 2009 15:01:33 +0100


On 10 Sep 2009, at 09:33, Jean-Daniel Dupas wrote:

My main concern would be block runtime linking issues. When you use blocks, the compiler generate call to the block runtime (libSystem on SL), but does it generate weak symbol or will the program crash at launch time on 10.5.

Note that a simple test will give the answer, but I don't have both OS right now.

This code (called from an obj-c method) runs on 10.6 but fails on 10.5 suggesting that cross development with GCD is not possible.
The crash report reports symbol not found __NSConcreteStackBlock in / usr/lib/libSystem.B.dylib
This would seem to suggest that even if dispatch_get_global_queue() is weakly linked the block symbols are not.


if (dispatch_get_global_queue(0, 0) != NULL) {
NSUInteger myInt = 1234;
NSLog(@"GCD dispatch...", nil);
dispatch_async(dispatch_get_global_queue(0, 0), ^{
NSString *myString = [NSString stringWithFormat:@"GCD dispatch: %u", myInt];

dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"Main thread: %@", myString);
});
});
NSLog(@"GCD dispatch sent", nil);
} else {
NSLog(@"GCD dispatch unavailable", nil);
}


Le 10 sept. 2009 à 00:49, Steve Christensen a écrit :

My understanding is that GCD is only supported on 10.6 and later. This means you'd need to have some sort of runtime check that would perform your tasks without GCD if running on a pre-10.6 OS version.


On Sep 9, 2009, at 3:04 PM, email@hidden wrote:

Sorry, not quite sure which list to hit here/

The Grand Central Dispatch headers seem to include availability macros.

Does that mean we can cross development for a deployment target of 10.5 with a 10.6 base SDK and use blocks and GCD?

_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

-- Jean-Daniel





Jonathan Mitchell

Developer
http://www.mugginsoft.com





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: GCD and blocks cross development
      • From: Jens Alfke <email@hidden>
References: 
 >GCD and blocks cross development (From: "email@hidden" <email@hidden>)
 >Re: GCD and blocks cross development (From: Steve Christensen <email@hidden>)
 >Re: GCD and blocks cross development (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: GCD and blocks cross development
  • Next by Date: Re: GCD and blocks cross development
  • Previous by thread: Re: GCD and blocks cross development
  • Next by thread: Re: GCD and blocks cross development
  • Index(es):
    • Date
    • Thread