1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/// Create the shared KVS blocking threadpool.
///
/// Size and pinning behaviour are driven by [`crate::cnf::KVS_THREADPOOL_SIZE`]:
///
/// * When the resolved size matches the host's logical core count *and* that count is at least 16,
/// the pool uses `affinitypool::thread_per_core` so each worker is pinned to a dedicated core.
/// This is the default on ≥16-core hosts.
/// * When the size is below 16 on a small-core host (the computed default floor), the pool is sized
/// to 16 unpinned workers — enough slack to absorb short bursts of blocking I/O without occupying
/// every core.
/// * When `SURREAL_KVS_THREADPOOL_SIZE` is set to an explicit value that does not equal the core
/// count (oversubscription or undersubscription), the pool drops pinning and uses that exact
/// worker count.
pub