Skip to content

Commit

Permalink
Determine number of threads in runtime environment
Browse files Browse the repository at this point in the history
  • Loading branch information
ak-coram committed Nov 5, 2023
1 parent 14c136c commit ef9daf1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions duckdb.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -926,10 +926,11 @@ intentionally."
(perform ,finish-statement))))))

;; Initialize the default number of threads based on DuckDB defaults
(unless *default-thread-count*
(with-open-database (db :threads nil)
(with-default-connection (db)
(setf *default-thread-count*
(get-result (query "SELECT current_setting('threads') AS thread_count"
nil)
'thread-count 0)))))
(eval-when (:execute)
(unless *default-thread-count*
(with-open-database (db :threads nil)
(with-default-connection (db)
(setf *default-thread-count*
(get-result (query "SELECT current_setting('threads') AS thread_count"
nil)
'thread-count 0))))))

0 comments on commit ef9daf1

Please sign in to comment.