[libdispatch-dev] testing tree now ported/automaked and committed

Robert Watson robert at fledge.watson.org
Thu Nov 5 01:18:59 PST 2009

Dear all:

Yesterday I committed an adaptation of the testing tree to the 
autoconf/automake build system.  Most tests now run on FreeBSD, and often 
report success.  Here's a quick summary:

   dispatch_c99             * But that is not the point of this test

Mixed success:
   dispatch_after           * Occasionally one or two fail
   dispatch_drift           * Jitter fails, drift passes
   dispatch_starfish        * Latency requirements not always met

Pass, but no 'leaks' testing on non-Mac OS X:

   dispatch_priority        * Blocks complete but fails precedence test

Doesn't yet run on FreeBSD:
   dispatch_cffd            * No Core Foundation on FreeBSD
   dispatch_cpp             * No working C++ compiler with blocks off Mac OS X
   dispatch_timer_set_time  * Requires legacy API

I've left the original Darwin Makefile as Makefile.darwin, as it contains 
better runtime packaging and summarization, as well as knowing about lipo on 
Mac OS X.  Some of this packaging should make it into the portable makefiles 
in the future.  I plan to spend time investigating dispatch_priority today.

Poor latency/jitter in some tests may be a result of my using a VM for 
testing, which I'll also investigate, but could also be a property of timer 
resolution, an off-by-one error in how wakeups are calculated (perhaps by the 
POSIX semaphore/kqueue code on FreeBSD?) but we'll see.

I also ommitted some fixes to the POSIX semaphore code in libdispatch; I had 
some of the timeout calculation and handling wrong.  One important semantic 
difference between Mach and POSIX semaphores is that their timed wait 
primitives take different time scales: Mach accepts a relative timeout, and 
POSIX and absolute timeout.  There are arguments for/against both approaches, 
but I was pondering adding a non-portable POSIX semaphore extension to FreeBSD 
supporting relative timeouts to avoid additional clock reads to convert 
between the two bases.

Robert N M Watson
Computer Laboratory
University of Cambridge

More information about the libdispatch-dev mailing list