30 msg (
"Main thread acquiring lock.");
34 msg (
"Main thread creating block thread, sleeping 25 seconds...");
38 msg (
"Main thread spinning for 5 seconds...");
43 msg (
"Main thread releasing lock.");
46 msg (
"Block thread should have already acquired lock.");
55 msg (
"Block thread spinning for 20 seconds...");
60 msg (
"Block thread acquiring lock...");
#define ASSERT(CONDITION)
This is outside the header guard so that debug.h may be included multiple times with different settin...
void msg(const char *format,...)
void test_mlfqs_block(void)
static void block_thread(void *lock_)
Checks that recent_cpu and priorities are updated for blocked threads.
static int64_t start_time
Starts 60 threads that each sleep for 10 seconds, then spin in a tight loop for 60 seconds,...
signed long long int int64_t
void lock_release(struct lock *lock)
Releases LOCK, which must be owned by the current thread.
void lock_init(struct lock *lock)
Initializes LOCK.
void lock_acquire(struct lock *lock)
Acquires LOCK, sleeping until it becomes available if necessary.
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...
#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.