Quizzes 2nd LE Flashcards
Complete command line to display threads in a process using ps
ps -T -p
Give one benefit of threads
Resource sharing
Responsiveness
Economy
Scalability
It is possible to provide concurrencybin a single core system. True or False?
True
What are the two thingsbthat are unique to a thread?
Stack and register
Give one example of a thread library
Posix Pthread
windows threads
Java threads
Give one example of a specification to support implicit threading
OpenMP
Grand central dispatch
Thread pools
Used in unix to notify a process about an event
Signals
In what scenarios are thread local storage useful
When using implicit threading such as thread pools wherein creation of threads is not managed by the programmer
The scenario in which concurrent access by processes/threads to a shared resource results to inconsistencies
Race condition
Part of the code wherein only one process/thread is allowed to execute at a given time
Critical condition
Mutex locks that require busy waiting
Spinlocks
In test-and-set hardware sync, what value is returned
Original value
What x86 instruction is used in compare-and-swap
Compare_and_swap()
We can use a semaphore in place of a mutex lock
True
A situation where a process may never be removed from the semaphore queue in which it is suspended
Starvation