Tutorial: Locks Flashcards

1
Q

lock_acquire can be just referred to as _____

A

lock

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

lock_release can be just referred to as _______

A

unlock

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

lock_acquire allows the caller to _______ _______ in the CS

A

exclusively, execute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

lock_release ____ the caller from the CS, allowing another lock requester to execute in the CS

A

exits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In the Lock API Pthread Locks, what is the lock type called?

A

pthread_mutex_t

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In the Lock API Pthread Locks, what is the acquire function signature?

A

pthread_mutex_lock(pthread_mutex_t* lock)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In the Lock API Pthread Locks, what is the release function signature??

A

pthread_mutex_unlock(pthread_mutex_t* lock)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

_______ ____ always succeeds, while _____ ____ _____ may fail

A

atomic, swap, compare, and, swap

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

______ ____ ______ is a more powerful primitive at it allows condition checking before executing.

A

compare, and, swap

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Compare and swap is more useful when building ____-____ data structures

A

lock free

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Both atomic swap and compare and swap only work on single ______ words

A

8-byte

How well did you know this?
1
Not at all
2
3
4
5
Perfectly