解决方法
开销应该可以忽略不计:您可以使用Instruments和一个简单的程序来检查:
#import <Foundation/Foundation.h> int main(int argc,const char * argv[]) { @autoreleasepool { dispatch_queue_t q = dispatch_get_global_queue(disPATCH_QUEUE_PRIORITY_HIGH,0); void (^b)(void) = ^{ }; double d = 2.0; for(int i = 0; i < 10000000; ++i) { dispatch_sync(q,b); d = d * 1.5 - 1.0; } NSLog(@"d = %.3f",d); } return 0; }