FreeBSD developer Robert Watson has announced an Apache GCD MPM that uses Apple’s Grand Central Dispatch concurrent programming framework, and cites 1/4 the number of lines of code for threaded MPMs to accomplish the same goals. Currently, the MPM is being distributed on Mac OS X Forge, and runs on FreeBSD and Mac OS X. Apache developer Paul Querna has proposed merging it to the Apache trunk. There are also ongoing efforts to port libdispatch to Solaris and Linux, so hopefully it will work there soon as well!
In case anyone else finds “… cites 1/4 the number of lines of code for threaded MPMs to accomplish the same goals.” ambiguous, it means that the GCD reduces the number of lines of code required by a factor of 4.
For this particular codebase. GCD is a thread pool, and it doesn’t make code any shorter then another thread pool implementation (like QtConcurrent) would.
“Blocks” (closures for C) would reduce the LOC count, but they are not widely supported (not standard C feature) and probably wouldn’t be admitted to Apache codebase…
In other words, use nginx.
Blocks are an essential part of Clang and is built-into LLVM.
Keeping thinking it’s not widely used.
I don’t think that counts as widely used…