[libdispatch-dev] lib dispatch worker threads may loop depending on compiler optimization

Joakim Johansson jocke at tbricks.com
Thu Sep 8 03:58:28 PDT 2011


We just filed http://libdispatch.macosforge.org/trac/ticket/35 after sometimes encountering spinning worker threads when running under high load on multi-cpu machines.

Various versions of gcc will optimize and reorder the code differently, but with 4.5.1 we run into this problem.

Is this a fundamental problem with libdispatch itself that will rear it’s ugly head if/when the Mac OS X system compiler is changed in the future (to optimize more aggressively), or is it a bug in the gcc 4.5.1 optimizer?

The Lion source code seems more or less unchanged here, so even if we tested this with the current r197 code base, the behavior should be the same when integrating the latest source drop.

Thoughts?

Thanks,

Joakim




More information about the libdispatch-dev mailing list