Sets of heap slots are bits, the heaps' records have threads of their own, what is mirrored of them is counted
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
3321b7e346
commit
a36d7dec8c
4 files changed
+134
-31
No files matched your search
@@ -325,15 +325,18 @@ pub(crate) fn each(count: usize, f: &(dyn Fn(usize) + Sync)) {
|
||||
}
|
||||
|
||||
/// Calls `f` with every number below `count`, on this thread and on threads
|
||||
/// kept for making descriptors (`VICTORY_VIEW_THREADS`, 5 with this one; 1:
|
||||
/// on this one alone).
|
||||
pub(crate) fn each_view(count: usize, f: &(dyn Fn(usize) + Sync)) {
|
||||
static POOL: OnceLock<&'static Pool> = OnceLock::new();
|
||||
POOL.get_or_init(|| {
|
||||
let threads = std::env::var("VICTORY_VIEW_THREADS").ok().and_then(|v| v.trim().parse().ok()).unwrap_or(5usize);
|
||||
Pool::new("victory-views", threads.clamp(1, 16))
|
||||
})
|
||||
.each(count, f);
|
||||
/// kept for making descriptors (`VICTORY_VIEW_THREADS`, 4 with this one; 1:
|
||||
/// on this one alone). Those for `records`, the heaps' records copied as
|
||||
/// bytes, are others than those for the views picked by index: submissions
|
||||
/// wait for the first, lists for the second, and each kept the other waiting.
|
||||
pub(crate) fn each_view(records: bool, count: usize, f: &(dyn Fn(usize) + Sync)) {
|
||||
static POOLS: [OnceLock<&'static Pool>; 2] = [const { OnceLock::new() }; 2];
|
||||
POOLS[usize::from(records)]
|
||||
.get_or_init(|| {
|
||||
let threads = std::env::var("VICTORY_VIEW_THREADS").ok().and_then(|v| v.trim().parse().ok()).unwrap_or(4usize);
|
||||
Pool::new(if records { "victory-records" } else { "victory-views" }, threads.clamp(1, 16))
|
||||
})
|
||||
.each(count, f);
|
||||
}
|
||||
|
||||
/// A piece to land: the copy's number, the title address, its bytes.
|
||||
|
||||
Reference in new issue
Block a user