Sockets, Threads and Resource Locking Flashcards
What does a socket allow?
A socket allows for two nodes on a network to talk to each other.
What are the advantages of threads over a forked process?
They are faster to create, switch between, and communicate between.
How are threads implemented in C?
They are not supported by language standard but are provided by POSIX in the form of pthreads.
What is mutex used for?
locking and unlocking a resource
What does a Semaphore do?
It is a signalling mechanism that protects a resource from being overwritten.
How is the Semaphore implemented?
If the Semaphore count is 0 then the thread waits until it isn’t to access the resource. The count is incremented and decremented as resources are accessed and released.