TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Martin Kiss.
Objective-C wrapper for Grand Central Dispatch with method for every single dispatch call and with some useful additions.
Contribution in form of Pull Requests, Feature Requests or Issues is welcome! Especially suggesing improved API for Dispatch Sources, Dispatch IO and Dispatch Data would be really appreciated.
dispatch_get_specific
.-sync:
method.-log:
which is replacement for deprecated dispacth_debug
.dispatch_once
.GODQueue *clusterQueue = [[GODQueue alloc] initWithName:@"cluster" concurrent:YES];
GODQueue *isolationQueue = [[GODQueue alloc] initWithName:@"isolation" concurrent:YES];
[clusterQueue apply:100 block:^(NSUInteger index) {
[isolationQueue sync:^{
// access shared resource
}];
// iterative calculation
[isolationQueue barrierAsync:^{
// modify shared resource
}];
}];
[clusterQueue barrierAsync:^{
// finalize data
[[GODQueue mainQueue] async:^{
// update UI
}];
}];
dispatch_queue_t clusterQueue = dispatch_queue_create("cluster", DISPATCH_QUEUE_CONCURRENT);
dispatch_queue_t isolationQueue = dispatch_queue_create("isolation", DISPATCH_QUEUE_CONCURRENT);
dispatch_apply(100, clusterQueue, ^(size_t index) {
dispatch_sync(isolationQueue, ^{
// access shared resource
});
// iterative calculation
dispatch_barrier_async(isolationQueue, ^{
// modify shared resource
});
});
dispatch_barrier_async(clusterQueue, ^{
// finalize data
dispatch_async(dispatch_get_main_queue(), ^{
// update UI
});
});
Version 0.5.0
MIT License, Copyright © 2013 Martin Kiss
THE SOFTWARE IS PROVIDED "AS IS", and so on...
see LICENSE.md
for more.