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

@ -134,11 +134,21 @@
(run-fibers
(lambda ()
(catch 'system-error
(lambda ()
(set-thread-name
(string-append "server")))
(const #t))
(let* ((current (current-scheduler))
(schedulers
(cons current (scheduler-remote-peers current))))
(for-each
(lambda (i sched)
(spawn-fiber
(lambda ()
(catch 'system-error
(lambda ()
(set-thread-name
(string-append "server " (number->string i))))
(const #t)))
sched))
(iota (length schedulers))
schedulers))
(while (not request-scheduler)
(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?)
(wait finished?))
#:hz 5
#:parallelism 1))
#:hz 0
#:parallelism 2))
finished?)))