Try using 2 threads for the server

This commit is contained in:
Christopher Baines 2024-07-26 21:42:21 +01:00
parent 2a80304e0c
commit e8bd27fdb8

View file

@ -133,12 +133,22 @@
#:parallelism 4))) #:parallelism 4)))
(run-fibers (run-fibers
(lambda ()
(let* ((current (current-scheduler))
(schedulers
(cons current (scheduler-remote-peers current))))
(for-each
(lambda (i sched)
(spawn-fiber
(lambda () (lambda ()
(catch 'system-error (catch 'system-error
(lambda () (lambda ()
(set-thread-name (set-thread-name
(string-append "server"))) (string-append "server " (number->string i))))
(const #t)) (const #t)))
sched))
(iota (length schedulers))
schedulers))
(while (not request-scheduler) (while (not request-scheduler)
(sleep 0.1)) (sleep 0.1))
@ -236,6 +246,6 @@ port. Also, the port used can be changed by passing the --port option.\n"
(spawn-port-monitoring-fiber port finished?) (spawn-port-monitoring-fiber port finished?)
(wait finished?)) (wait finished?))
#:hz 5 #:hz 0
#:parallelism 1)) #:parallelism 2))
finished?))) finished?)))