Try using 2 threads for the server
This commit is contained in:
parent
2a80304e0c
commit
e8bd27fdb8
1 changed files with 17 additions and 7 deletions
|
|
@ -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?)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue