summaryrefslogtreecommitdiff
path: root/tests/speedup.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2017-02-19 21:18:21 +0100
committerAndy Wingo <wingo@pobox.com>2017-02-19 21:18:21 +0100
commita9354b5a47c978d9bbc7095ea872e50e72f8800d (patch)
tree7c4529b65b5ca076d97e9e665fc434cf7ca55410 /tests/speedup.scm
parentFix make -j problem (diff)
downloadguile-fibers-a9354b5a47c978d9bbc7095ea872e50e72f8800d.tar.gz
run-fibers returns when initial fiber finishes
* epoll.c (scm_primitive_epoll_wait): Accept timeout in internal time units instead of milliseconds. Avoid some overhead if the timeout is zero. * fibers/epoll.scm (epoll): Adapt to primitive-epoll-wait chance. Change get-timeout callback to an "expiry" argument and an update-expiry last-minute function. Tighten the window around the "waiting" epoll-state. * fibers.scm (%run-fibers): Remove current-read-waiter / current-write-waiter parameterization, given that fibers individually each have this parameterization. (run-fibers): Add #:drain? argument. * fibers/internal.scm (schedule-runnables-for-next-turn): Simplify a bit, inlining scheduler-poll-timeout and adapting to epoll change. (scheduler-work-pending?): New function. (run-scheduler): Simplify finish? logic. * tests/basic.scm: * tests/speedup.scm: Update to drain where needed. * fibers.texi: Update for new run-fibers termination condition.
Diffstat (limited to 'tests/speedup.scm')
-rw-r--r--tests/speedup.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/speedup.scm b/tests/speedup.scm
index ea67d6a..6dfe969 100644
--- a/tests/speedup.scm
+++ b/tests/speedup.scm
@@ -40,9 +40,10 @@
(format #t "speedup for ~s: " 'exp)
(force-output)
(let ((thunk (lambda () exp)))
- (let ((t1 (time (lambda () (run-fibers thunk #:parallelism 1)))))
+ (let ((t1 (time (lambda ()
+ (run-fibers thunk #:parallelism 1 #:drain? #t)))))
(format #t "~a s" t1)
- (let ((t2 (time (lambda () (run-fibers thunk)))))
+ (let ((t2 (time (lambda () (run-fibers thunk #:drain? #t)))))
(format #t " / ~a s = ~ax (~a cpus)\n" t2 (/ t1 t2)
(current-processor-count)))))))