diff options
author | Christopher Baines <mail@cbaines.net> | 2022-10-02 15:08:18 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2022-10-02 15:08:18 +0100 |
commit | ff77bbea7e647a07c5601e51704c04258a73b79f (patch) | |
tree | 27bc83b7a83e143b1869be17eb99b9330f89629d /guix-data-service | |
parent | ce2e13aa45211492950595c3758467488023c3f9 (diff) | |
download | data-service-ff77bbea7e647a07c5601e51704c04258a73b79f.tar data-service-ff77bbea7e647a07c5601e51704c04258a73b79f.tar.gz |
Make it possible to increase the number of thread pool threads
And double the default to 16.
Diffstat (limited to 'guix-data-service')
-rw-r--r-- | guix-data-service/utils.scm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/guix-data-service/utils.scm b/guix-data-service/utils.scm index f5a1128..6be5cc5 100644 --- a/guix-data-service/utils.scm +++ b/guix-data-service/utils.scm @@ -28,6 +28,7 @@ with-time-logging prevent-inlining-for-tests + %thread-pool-threads parallel-via-thread-pool-channel par-map& letpar& @@ -55,7 +56,10 @@ (define-syntax-rule (prevent-inlining-for-tests var) (set! var var)) -(define* (make-thread-pool-channel #:key (threads 8)) +(define %thread-pool-threads + (make-parameter 8)) + +(define* (make-thread-pool-channel threads) (define (delay-logger seconds-delayed) (when (> seconds-delayed 1) (format @@ -107,7 +111,8 @@ (define (make-thread-pool-channel!') (with-mutex %thread-pool-mutex (unless %thread-pool-channel - (set! %thread-pool-channel (make-thread-pool-channel)) + (set! %thread-pool-channel (make-thread-pool-channel + (%thread-pool-threads))) (set! make-thread-pool-channel! (lambda () #t))))) (define make-thread-pool-channel! |