flâneur — a map of the web's best reading

Implementation requirements | CS 162 Project 2

cs162.org · 1,663 words · saved by 1 readers

Creates a new user thread running stub function sfun, with arguments tfun and arg. Returns TID of created thread, or TID_ERROR if allocation failed. void sys_pthread_exit(void) NO RETURN Terminates the calling user thread. If the main thread calls pthread_exit, it should join on all currently active threads, and then exit the process. tid_t sys_pthread_join(tid_t tid) Suspends the calling thread until the thread with TID tid finishes. Returns the TID of the thread waited on, or TID_ERROR if the thread could not be joined on. It is only valid to join on threads that are part of the same process and have not yet been joined on. It is valid to join on a thread that was part of the same process, but has already terminated – in such cases, the sys_pthread_join call should not block. Any thread can join on any other thread (the main thread included). If a thread joins on main, it should be woken up and allowed to run after main calls pthread_exit but before the process is killed (see above).

Implementation requirements | CS 162 Project 2 Skip to main content Menu Expand (external link) Document Search Copy Copied CS 162 Project 2 Implementation requirements Table of contents New syscalls pthread syscalls User-level synchronization syscalls Other Modifications to process control syscalls Exit Codes Synchronization Implementation hints Additional information New syscalls For this project, you will need to implement the following new system calls: pthread syscalls tid_t sys_pthread_create(stub_fun sfun, pthread_fun tfun, const void* arg) Creates a new user thread running stub functio

Explore this link on the map →

saved by

related reading