On 27 jul 2010, at 12.33, Joakim Johansson wrote:
I will try it using Mark Heily’s userspace pthread_workqueue implementation as well and see how that works.
And the answer is… Quite a bit better! I just tried it with libdispatch r188 + Solaris patches + libkqueue r280, results included below (there is an example of the spurious failures mentioned in dispatch_priority2). The number of threads are now around 17, which seems much more reasonable on my machine, and the machine is no longer pushed up to a system load of 75 when running the tests… :-) Latency for starfish is much more consistent and has overall lower values. It would definitely be very nice to have the pthread_workqueue implementation integrated as a fallback as previously discussed between Mark/Jordan over time. Joakim ————————————————— node5:~/gcd/trunk/testing> ./dispatch_api ================================================== [TEST] Dispatch (Public) API [PID] 13047 ================================================== Actual: 412870 Expected: 412870 [PASS] dispatch_get_main_queue node5:~/gcd/trunk/testing> ./dispatch_c99 ================================================== [TEST] Dispatch C99 [PID] 13062 ================================================== Actual: 412870 Expected: 412870 [PASS] dispatch_get_main_queue node5:~/gcd/trunk/testing> ./dispatch_cascade ================================================== [TEST] Dispatch Cascade [PID] 13077 ================================================== maxcount = 1172 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** ** * * * * * * * * ** ** * * * * * * * * ** ** * * ** * * * * * * * ** ** * **** * * ** * * * * * * * * ** **** **** * * ** * * ** * * * * * * * ** ** **** **** * * **** * ** * * * **** * * ** * * node5:~/gcd/trunk/testing> ./dispatch_debug ================================================== [TEST] Dispatch Debug [PID] 13092 ================================================== node5:~/gcd/trunk/testing> ./dispatch_priority ================================================== [TEST] Dispatch Priority [PID] 13107 ================================================== LOW: 37 ************************ DEFAULT: 71 ********************************************* HIGH: 84 ***************************************************** Actual: 192 Expected: 192 [PASS] blocks completed Actual: 37 Expected: <84 [PASS] high priority precedence node5:~/gcd/trunk/testing> ./dispatch_priority2 ================================================== [TEST] Dispatch Priority (Set Target Queue) [PID] 13122 ================================================== Actual: 413170 Expected: 413170 [PASS] q[i] Actual: 417480 Expected: 417480 [PASS] q[i] Actual: 417530 Expected: 417530 [PASS] q[i] LOW: 63 **************************************** DEFAULT: 64 **************************************** HIGH: 66 ****************************************** Actual: 193 Expected: 192 [FAIL] blocks completed (dispatch_priority.c:82) dispatch_priority.c:82 Actual: 63 Expected: <66 [PASS] high priority precedence node5:~/gcd/trunk/testing> ./dispatch_starfish ================================================== [TEST] Dispatch Starfish [PID] 13137 ================================================== lap: 10 count: 1000 delta: 723891749 ns math: 361.584290 ns / lap Actual: 361 Expected: <1000 [PASS] Latency lap: 9 count: 1000 delta: 699582448 ns math: 349.441782 ns / lap Actual: 349 Expected: <1000 [PASS] Latency lap: 8 count: 1000 delta: 799519154 ns math: 399.360217 ns / lap Actual: 399 Expected: <1000 [PASS] Latency lap: 7 count: 1000 delta: 802168767 ns math: 400.683700 ns / lap Actual: 400 Expected: <1000 [PASS] Latency lap: 6 count: 1000 delta: 720398591 ns math: 359.839456 ns / lap Actual: 359 Expected: <1000 [PASS] Latency lap: 5 count: 1000 delta: 932910394 ns math: 465.989208 ns / lap Actual: 465 Expected: <1000 [PASS] Latency lap: 4 count: 1000 delta: 825487034 ns math: 412.331186 ns / lap Actual: 412 Expected: <1000 [PASS] Latency lap: 3 count: 1000 delta: 772381517 ns math: 385.804954 ns / lap Actual: 385 Expected: <1000 [PASS] Latency lap: 2 count: 1000 delta: 826056037 ns math: 412.615403 ns / lap Actual: 412 Expected: <1000 [PASS] Latency lap: 1 count: 1000 delta: 867257324 ns math: 433.195467 ns / lap Actual: 433 Expected: <1000 [PASS] Latency node5:~/gcd/trunk/testing> ./queue_finalizer ================================================== [TEST] Dispatch Queue Finalizer [PID] 13152 ================================================== Actual: 4133b0 Expected: 4133b0 [PASS] dispatch_queue_new Actual: 8e3ce4e70cba8e97 Expected: 8e3ce4e70cba8e97 [PASS] finalizer ran node5:~/gcd/trunk/testing> /usr/sbin/psrinfo 0 on-line since 04/30/2010 16:29:35 1 on-line since 04/30/2010 16:29:46 2 on-line since 04/30/2010 16:29:46 3 on-line since 04/30/2010 16:29:46 4 on-line since 04/30/2010 16:29:46 5 on-line since 04/30/2010 16:29:46 6 on-line since 04/30/2010 16:29:46 7 on-line since 04/30/2010 16:29:46 node5:~/gcd/trunk/testing> —————————————————