Concurrency Flashcards

1
Q

What is an executor?

A

An executor is an object that executes runnable tasks

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

Describe an executor?

A

An executor is an object that executes runnable tasks

It decouples task from how it is executed

Task doesn’t need to be asynchronous

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

Does an executor require the task to be asynchronous?

A

No

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

Describe 3 ways to support concurrency?

A

Executors
Blocking queues
Synchronized

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

What is blocking queue in Java?

A

A blocking queue is an interface that can be implemented to create thread safe queues which means multiple threads can access it concurrently

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

What are the 2 types of blocking queues?

A

Bounded queue
Unbounded queue

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

What is the capacity of a blocking queue?

A

Integer.MAX_VALUE

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