Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#6831 sched refactor, step 7: Split eof_or_idle #7083

Merged
merged 7 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
498 changes: 490 additions & 8 deletions clients/drcachesim/scheduler/scheduler_dynamic.cpp

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions clients/drcachesim/scheduler/scheduler_fixed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@
#include "scheduler_impl.h"

#include <cinttypes>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <mutex>
#include <unordered_map>
#include <vector>

#include "memref.h"
#include "mutex_dbg_owned.h"
Expand Down Expand Up @@ -151,6 +155,18 @@ scheduler_fixed_tmpl_t<RecordType, ReaderType>::check_for_input_switch(
return sched_type_t::STATUS_OK;
}

template <typename RecordType, typename ReaderType>
typename scheduler_tmpl_t<RecordType, ReaderType>::stream_status_t
scheduler_fixed_tmpl_t<RecordType, ReaderType>::eof_or_idle_for_mode(
output_ordinal_t output, input_ordinal_t prev_input)
{
if (options_.mapping == sched_type_t::MAP_TO_CONSISTENT_OUTPUT ||
this->live_input_count_.load(std::memory_order_acquire) == 0) {
return sched_type_t::STATUS_EOF;
}
return sched_type_t::STATUS_IDLE;
}

template class scheduler_fixed_tmpl_t<memref_t, reader_t>;
template class scheduler_fixed_tmpl_t<trace_entry_t,
dynamorio::drmemtrace::record_reader_t>;
Expand Down
Loading
Loading