140 msg (
"Starting threads took %d seconds.",
144 for (i = 0; i < 90; i++)
150 msg (
"After %d seconds, load average=%d.%02d.",
151 i * 2, load_avg / 100, load_avg % 100);
158 int seq_no = (int) seq_no_;
#define ASSERT(CONDITION)
This is outside the header guard so that debug.h may be included multiple times with different settin...
int snprintf(char *buffer, size_t buf_size, const char *format,...)
Like printf(), except that output is stored into BUFFER, which must have space for BUF_SIZE character...
void msg(const char *format,...)
static void load_thread(void *seq_no)
void test_mlfqs_load_avg(void)
static int64_t start_time
Starts 60 threads numbered 0 through 59.
signed long long int int64_t
bool thread_mlfqs
If false (default), use round-robin scheduler.
tid_t thread_create(const char *name, int priority, thread_func *function, void *aux)
Creates a new kernel thread named NAME with the given initial PRIORITY, which executes FUNCTION passi...
void thread_set_nice(int nice UNUSED)
Sets the current thread's nice value to NICE.
int thread_get_load_avg(void)
Returns 100 times the system load average.
#define PRI_DEFAULT
Default priority.
int64_t timer_ticks(void)
Returns the number of timer ticks since the OS booted.
int64_t timer_elapsed(int64_t then)
Returns the number of timer ticks elapsed since THEN, which should be a value once returned by timer_...
void timer_sleep(int64_t ticks)
Sleeps for approximately TICKS timer ticks.
#define TIMER_FREQ
Number of timer interrupts per second.