Lecture Qs Flashcards
How many bits in the data bus and address bus?
64 bits
What is the size of the restricted address space that manufacturers usually use?
48 bits, RAM doesn’t need full 64
If you have processes of the same priority how are the selected?
Round robin
Are new tabs in google threads or processes?
Processes so that one tab doesn’t crash entire program.
Which thread will activate first after a spin unlock?
Unkown, spin locks aren’t fair, there is no set order.
What happens in a spin lock without thr_yield?
It will still work, but the loop will be moved to the end of the queue, and use more CPU than needed.
When is it acceptable to use a spin lock instead of mutex?
A small segment of code that doesn’t require waiting.
Are spin locks and mutexes fair?
Only mutex is fair.
In POSIX which threads are copied over during fork?
Only the thread calling fork.
What does the r stand for in ctime_r?
re entrant
Why is there a mutex lock along with the semaphore for the list class?
Because multiple threads could try to insert or remove at the same time.
What is starvation as opposed to a deadlock?
Resource just takes a while to free up, ex: taking a while to be able to write from too many readers in RW locks.
Which call waits until a network connection from a client arrives and returns a file descriptor for that client connection?
accept()
What is a grid vs a cluster of computers?
Cluster used for databases like google and meta. Grid represents home computers contributing to a common cause.
In the Internet Protocol used to send data on the Internet, which of the following is true about data packets?
a) packets may get lost
b) packets may get duplicated
c) packets may be corrupted
d) all of the above
d
next lecture 4/25