Skip to content

Commit

Permalink
Use readahead_useCVLocks = nthreads<=16
Browse files Browse the repository at this point in the history
  • Loading branch information
sfiligoi committed Sep 13, 2024
1 parent 1da1cce commit f5a6221
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bt2_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4719,7 +4719,9 @@ static void multiseedSearch(
// The condition_variable synchronization can be problematic
// in certain situations.
// Disabling it and using the polling-based lock-free mechanism can help there
bool readahead_useCVLocks = false; // TODO: Make it dynamic... preserve old behavior for now
// The (relative) polling cost is much higher for low thread count, so use that as a treshold
bool readahead_useCVLocks = nthreads<=16; // Note: We may want to consider other factors, too

// Important: Need at least nthreads+1 elements, more is OK
PatternSourceReadAheadFactory readahead_factory(patsrc,pp,4*nthreads+1,readahead_useCVLocks);
multiseed_readahead_factory = &readahead_factory;
Expand Down

0 comments on commit f5a6221

Please sign in to comment.