Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-singer committed Jan 23, 2025
1 parent d30139c commit 8c3fab7
Show file tree
Hide file tree
Showing 4 changed files with 254 additions and 196 deletions.
19 changes: 19 additions & 0 deletions runtime/efficiency.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef _EFFICIENCY_H
#define _EFFICIENCY_H
// Information for histories of efficient and inefficient worker-count samples
// and for sentinel counts.
typedef uint32_t history_sample_t;
#define HISTORY_LENGTH 32
#define SENTINEL_COUNT_HISTORY 4

typedef struct history_t {
history_sample_t inefficient_history;
history_sample_t efficient_history;
unsigned int sentinel_count_history_tail;
unsigned int recent_sentinel_count;
unsigned int fails;
unsigned int sample_threshold;
unsigned int sentinel_count_history[SENTINEL_COUNT_HISTORY];
} history_t;

#endif
Loading

0 comments on commit 8c3fab7

Please sign in to comment.