Implement the User Thread Library

Job ID: 35880371

Budget: $30 – $250 USD

You will implement a simplified version of many-to-one user-level threads in the form of a library called Simple Threads.
In the many-to-one model for user-level threads, all threads execute on the same kernel thread. As there is only one kernel-level thread associated with the process (the process containing threads is represented by a single context within the kernel), only one user-level thread may run at a time. Your thread manager will include a preemptive round-robin scheduler. If a thread does not yield during its time-slice, it will be preempted and one of the other ready threads will be resumed. The preempted and resumed threads should change state accordingly.

You will also implement thread synchronization and demonstrate that it works as expected. Implement the equivalent of pthread mutex lock, pthread mutex unlock, and pthread join, and pthread barrier wait – call them uthread mutex lock, uthread mutex unlock, uthread join, and uthread barrier wait – in your user threads (additional functions may be needed to complete these components; use your best judgement). You may use semaphores from semaphore.h, but you may NOT use the pthread library functions.
Related categories: C Programming UNIX