forked from amir/filehasher
Updating the IO Ring, Updating the progress printing fn
This commit is contained in:
@@ -74,7 +74,7 @@ int main(int argc, char **argv) {
|
||||
mem_arena *gp_arena = arena_create(¶ms);
|
||||
|
||||
// -------------------------------
|
||||
// Detect hardware threads
|
||||
// Detect hardware
|
||||
// -------------------------------
|
||||
// --- Windows: detect PHYSICAL cores (not logical threads) ---
|
||||
size_t hw_threads = platform_physical_cores();
|
||||
@@ -86,6 +86,8 @@ int main(int argc, char **argv) {
|
||||
hw_threads);
|
||||
printf(" Selected instruction set: %s\n", get_xxhash_instruction_set());
|
||||
|
||||
// Align IO Ring block size to the system page size
|
||||
u64 g_ioring_read_block = ALIGN_UP_POW2(IORING_READ_BLOCK, g_pagesize);
|
||||
// -------------------------------
|
||||
// Scanning and hashing
|
||||
// -------------------------------
|
||||
@@ -127,9 +129,8 @@ int main(int argc, char **argv) {
|
||||
workers[i].arena = arena_create(¶ms);
|
||||
workers[i].file_queue = &file_queue;
|
||||
|
||||
if (thread_create(&hash_threads[i], (ThreadFunc)hash_worker_io_ring, &workers[i])
|
||||
!=
|
||||
0) {
|
||||
if (thread_create(&hash_threads[i], (ThreadFunc)hash_worker_io_ring,
|
||||
&workers[i]) != 0) {
|
||||
fprintf(stderr, "Failed to create hash thread %zu\n", i);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user