Skip to content

Commit

Permalink
Define and use readahead_useCVLocks at object creation
Browse files Browse the repository at this point in the history
  • Loading branch information
sfiligoi committed Sep 13, 2024
1 parent de2596d commit 1da1cce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion bt2_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4716,8 +4716,12 @@ static void multiseedSearch(
EList<int> tids;
EList<std::thread*> threads(nthreads);
EList<thread_tracking_pair> tps;
// 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
// Important: Need at least nthreads+1 elements, more is OK
PatternSourceReadAheadFactory readahead_factory(patsrc,pp,4*nthreads+1);
PatternSourceReadAheadFactory readahead_factory(patsrc,pp,4*nthreads+1,readahead_useCVLocks);
multiseed_readahead_factory = &readahead_factory;

tps.resize(std::max(nthreads, thread_ceiling));
Expand Down
2 changes: 1 addition & 1 deletion pat.h
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ class PatternSourceReadAheadFactory {

PatternSourceReadAheadFactory(
PatternComposer& composer,
const PatternParams& pp, size_t n, bool useCV=false) :
const PatternParams& pp, size_t n, bool useCV) :
psfact_(composer,pp),
psq_ready_(useCV),
psq_idle_(useCV,psfact_,n),
Expand Down

0 comments on commit 1da1cce

Please sign in to comment.