#ifndef _UTHREADS_H #define _UTHREADS_H /* * User-Level Threads Library (uthreads) * Author: OS, os@cs.huji.ac.il */ #define MAX_THREAD_NUM 100 /* maximal number of threads */ #define STACK_SIZE 4096 /* stack size per thread (in bytes) */ /* external interface */ /* Initialize thread library */ int thread_init(int quantumUsecs); /* Create a new thread whose entry point is f */ int thread_spawn(void (*f)(void)); /* Terminate a thread */ int thread_terminate(int tid); /* Suspend a thread */ int thread_suspend(int tid); /* Resume a thread */ int thread_resume(int tid); /* Get thread id */ int thread_gettid(); /* Get total quantums */ int thread_get_total_quantums(); /* Get current thread's quantums */ int thread_get_my_quantums(); #endif