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

Pthread library | CS 162 Project 2

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

A subset of the pthread (Pintos thread) library is provided for you in lib/user/pthread.h. These functions serve as the glue between the high-level API of pthread_create, pthread_exit, and pthread_join and the low-level system call implementation of these functions. We’ll walk you through how the pthread library works by starting at the high-level usage in one of our tests, and walk down the stack until we get to the kernel syscall interface. The test we will walk through is tests/userprog/multithreading/create-simple.c. In the create-simple test, we see how the high-level API of the threading library is supposed to work. The main thread of the process first runs test_main. It then creates a new thread to run thread_function with the pthread_check_create call, and waits for that thread to finish with the pthread_check_join. The expected output of this test is shown in tests/userprog/multithreading/create-simple.ck. The functions pthread_check_create and pthread_check_join are simple wr

Pthread library | CS 162 Project 2 Skip to main content Menu Expand (external link) Document Search Copy Copied CS 162 Project 2 Pthread library Table of contents Threading User-level synchronization Threading A subset of the pthread (Pintos thread) library is provided for you in lib/user/pthread.h . These functions serve as the glue between the high-level API of pthread_create , pthread_exit , and pthread_join and the low-level system call implementation of these functions. We’ll walk you through how the pthread library works by starting at the high-level usage in one of our tests, and walk d

Explore this link on the map →

related reading