Skip to content

Commit

Permalink
Fix Windows build warning; add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
derekbruening committed Dec 13, 2023
1 parent e6507a1 commit 5e28ddf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions clients/drcachesim/scheduler/scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1636,6 +1636,7 @@ scheduler_tmpl_t<RecordType, ReaderType>::pop_from_ready_queue(
add_to_ready_queue(save);
VDO(this, 1, {
static int heartbeat;
// We are ok with races as the cadence is approximate.
if (++heartbeat % 500 == 0) {
VPRINT(this, 1, "heartbeat[%d] %zd in queue; %d blocked => %d %d\n",
for_output, ready_priority_.size(), num_blocked_,
Expand Down Expand Up @@ -2076,9 +2077,9 @@ scheduler_tmpl_t<RecordType, ReaderType>::next_record(output_ordinal_t output,
// do return an error on a time smaller than an input's current start time when we
// check for quantum end.
if (cur_time == 0) {
// It's more efficient for QUANTUM_TIME to get the time here instead of
// in get_output_time(). This also makes the two more similarly behaved
// with respect to blocking system calls.
// It's more efficient for QUANTUM_INSTRUCTIONS to get the time here instead of
// in get_output_time(). This also makes the two more similarly behaved with
// respect to blocking system calls.
cur_time = get_time_micros();
}
outputs_[output].cur_time = cur_time; // Invalid values are checked below.
Expand Down
2 changes: 1 addition & 1 deletion clients/drcachesim/scheduler/scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ template <typename RecordType, typename ReaderType> class scheduler_tmpl_t {
uint64_t time_spent_in_quantum = 0;
// These fields model waiting at a blocking syscall.
// The units are us for instr quanta and simuilation time for time quanta.
uint64_t blocked_time = 0.;
uint64_t blocked_time = 0;
uint64_t blocked_start_time = 0;
};

Expand Down

0 comments on commit 5e28ddf

Please sign in to comment.