Simple User Threads Library (uth_lib) << Features >> A) Preemptive thread library o Multiple threads of control o Periodic clock handler o RR scheduling within high and low priority tasks B) Synchronization primitives o Synchronization primitives (locks and condition variables) << Example >> const int N = 8; enum uth_priority_t { HI_PRI=0, LO_PRI, IDLE_PRI }; struct thr_arg { int id; int n; }; typdef struct thr_arg thr_arg_t; typedef void func0_t( void ); int main (...) { int tickSz; int debug; thr_arg_t thr_arg[N]; uth_tid_t thr[N+1]; int result; if ( uth_init( N+1, tickSz=10, debug=0 ) < 0 ) { ... Error ... } for (int i=0; iid; int n = arg->n; int result; ... compute ... uth_exit( result ); } void thr_mon( void *arg ) { ... save cpu usage of each thread once per second ... }