Skip to content

Commit

Permalink
i#6831 sched refactor, step 7: Split eof_or_idle
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 committed Nov 14, 2024
1 parent ed18bd6 commit 3697115
Show file tree
Hide file tree
Showing 6 changed files with 572 additions and 520 deletions.
492 changes: 484 additions & 8 deletions clients/drcachesim/scheduler/scheduler_dynamic.cpp

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions clients/drcachesim/scheduler/scheduler_fixed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,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 3697115

Please sign in to comment.