Skip to content

Commit

Permalink
i#6831 sched refactor, step 7: Split eof_or_idle (#7083)
Browse files Browse the repository at this point in the history
Splits eof_or_idle() into separate overrides in the 3 scheduler
subclasses. This then allows moving pop_from_ready_queue*() into the
dynamic subclass.

Moves process_markers(), ready_queue_empty(), and
syscall_incurs_switch() into the dynamic subclass.

Issue: #6831
  • Loading branch information
derekbruening authored Nov 15, 2024
1 parent 7491c9c commit 336bac6
Show file tree
Hide file tree
Showing 6 changed files with 596 additions and 521 deletions.
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

0 comments on commit 336bac6

Please sign in to comment.