3 ms·
Has anyone used both Intel's Thread Building Blocks and Apple's Grand Central Dispatch? GCD is focused around adding blocks to C and managing dispatch queues.
by pkaler 16y ago
Has anyone used both Intel's Thread Building Blocks and Apple's Grand Central Dispatch? GCD is focused around adding blocks to C and managing dispatch queues.
Anyone have pros and cons of both frameworks?
- Zev 16y agoGCD is separate from blocks; you can use one without the other. GCD/libdispatch is a library written for concurrent execution and to make it easier to manage. Blocks are closures added to C, Objective-C and C++. Lambda's have also been (or rather, will be) added to C++, in C++0x. I've never used Intel's TBB, but it looks like it is similar to what libdispatch's purpose is. Of course, I could be way off base. But, I don't think I am.
- jmah 16y agoThere was a session at WWDC 2009 given by a couple of Intel engineers comparing the two. (Session 131, if you have access.) In their benchmark - parallel pipelined face detection - they were within about 1% of each other. GCD scaled up to more cores slightly better. Because it was initially built for TBB, they had to use some additional logic when moving to GCD so that frames would be rearranged into sequential order before certain stages.