Concurrency Flashcards
1
Q
What is an executor?
A
An executor is an object that executes runnable tasks
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
3
Q
Does an executor require the task to be asynchronous?
A
No
4
Q
Describe 3 ways to support concurrency?
A
Executors
Blocking queues
Synchronized
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
6
Q
What are the 2 types of blocking queues?
A
Bounded queue
Unbounded queue
7
Q
What is the capacity of a blocking queue?
A
Integer.MAX_VALUE