[libdispatch-dev] Fully functional libdispatch port for Windows and Linux

Kevin Van Vechten kvv at apple.com
Fri Feb 11 10:24:59 PST 2011

Hi Marius,

It's great that you have enough interest in the libdispatch project to work on a port to Linux and Win32. If you weren't aware, we already have Linux and partial Win32 support in the primary libdispatch source repository. I would encourage you to contribute modifications to the primary project rather than attempt a complete rewrite.

I reviewed some of the sources of "libxdispatch" and I can see that this does approximate the libdisptach API at a high level, but it's important to keep in mind some of the aspects of the libdispatch implementation that set it apart — specifically thread safety and wait-free algorithms — which allow it to scale well with large numbers of cores and heavy load. I noted several places in the libxdispatch/core/queue.c implementation where thread safety was questionable and other cases where simple spin locks (waiting) were in use.

I'd be happy to answer any specific questions you may have about the libdispatch implementation or scalability goals.


On Feb 11, 2011, at 10:06 AM, Marius Zwicker wrote:

> Hi everyone,
> I'm glad to announce that I finished a port of libdispatch to Linux and Windows during the last days. Except the source interfaces (which differ too much between Windows and Linux) the API should be fully operational. The majority of your original tests is passing - some of them still need to be ported to build and run on all platforms. As I did not manage to understand your code completely, I did a complete rewrite and merely reused your api and general ideas.
> For achieving "blocks support" on the majority of the used compilers I added lambda support from the upcoming C++0x standard.
> Additionally I implemented (for those who need and use it) an interface to integrate libdispatch into applications developed using the Qt framework.
> As my port is a bit more than a patch, I named it libxdispatch and it is currently available by going to http://opensource.mlba-team.de/xdispatch - I'm really curious about your comments.
> Regards,
> Marius Zwicker

More information about the libdispatch-dev mailing list