eliminate incorrect cases of async_push_work, where pushes which could occur on worker threads may try to write to a cache that is currently being held, when the push occurs (when all threads are saturated) - async_push_work must never be called from within a cache locking mechanism

This commit is contained in:
Ryan Fleury
2024-11-14 09:55:03 -08:00
parent ff45952f07
commit 420f089fda
3 changed files with 24 additions and 12 deletions
+4 -1
View File
@@ -152,7 +152,10 @@ fs_hash_from_path_range(String8 path, Rng1U64 range, U64 endt_us)
{
ins_atomic_u64_eval_assign(&range_node->last_time_requested_us, os_now_microseconds());
ins_atomic_u64_inc_eval(&range_node->request_count);
async_push_work(fs_stream_work, .completion_counter = &range_node->completion_count);
DeferLoop(os_rw_mutex_drop_w(path_stripe->rw_mutex), os_rw_mutex_take_w(path_stripe->rw_mutex))
{
async_push_work(fs_stream_work, .completion_counter = &range_node->completion_count);
}
}
// rjf: try to reobtain results