Quizzes 2nd LE Flashcards

1
Q

Complete command line to display threads in a process using ps

A

ps -T -p

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

Give one benefit of threads

A

Resource sharing
Responsiveness
Economy
Scalability

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

It is possible to provide concurrencybin a single core system. True or False?

A

True

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

What are the two thingsbthat are unique to a thread?

A

Stack and register

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

Give one example of a thread library

A

Posix Pthread
windows threads
Java threads

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

Give one example of a specification to support implicit threading

A

OpenMP
Grand central dispatch
Thread pools

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

Used in unix to notify a process about an event

A

Signals

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

In what scenarios are thread local storage useful

A

When using implicit threading such as thread pools wherein creation of threads is not managed by the programmer

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

The scenario in which concurrent access by processes/threads to a shared resource results to inconsistencies

A

Race condition

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

Part of the code wherein only one process/thread is allowed to execute at a given time

A

Critical condition

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

Mutex locks that require busy waiting

A

Spinlocks

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

In test-and-set hardware sync, what value is returned

A

Original value

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

What x86 instruction is used in compare-and-swap

A

Compare_and_swap()

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

We can use a semaphore in place of a mutex lock

A

True

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

A situation where a process may never be removed from the semaphore queue in which it is suspended

A

Starvation

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