summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2017-01-08 14:17:56 +0100
committerAndy Wingo <wingo@pobox.com>2017-01-08 14:17:56 +0100
commit2d31bd4ba7df8966301e517717c52dae504aec1c (patch)
treeb80105dbb0d5d377febde72c4714f2b2548a64f7
parentPeer schedulers share a prompt tag (diff)
downloadguile-fibers-2d31bd4ba7df8966301e517717c52dae504aec1c.tar.gz
Enable preemption by default
* fibers.scm (run-fibers): Enable preemption by default with a period of 10ms.
-rw-r--r--fibers.scm5
1 files changed, 2 insertions, 3 deletions
diff --git a/fibers.scm b/fibers.scm
index 8312d7a..270c912 100644
--- a/fibers.scm
+++ b/fibers.scm
@@ -24,8 +24,7 @@
#:use-module (fibers repl)
#:use-module (fibers timers)
#:use-module (fibers interrupts)
- #:use-module ((ice-9 threads)
- #:select (current-thread current-processor-count))
+ #:use-module (ice-9 threads)
#:use-module ((ice-9 ports internal)
#:select (port-read-wait-fd port-write-wait-fd))
#:use-module (ice-9 suspendable-ports)
@@ -73,7 +72,7 @@
(lp (1+ i)))))))
(define* (run-fibers #:optional (init #f)
- #:key (hz 0) (scheduler #f)
+ #:key (hz 100) (scheduler #f)
(parallelism (current-processor-count))
(install-suspendable-ports? #t))
(when install-suspendable-ports? (install-suspendable-ports!))