Lecture 7 - Asynchronous Tasks Flashcards

1
Q

What is std::async?

A

Creates an asynchronous task (higher level than threads) to complete alongside current thread.

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

What type is std::async?

A

std::future<>, this is a value that is to be evaluated in the future

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

What is a future handle?

A

represents a value to be computed

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

How to get the value of future?

A

_.get()

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

What happens if value of async task is not ready and we call .ge()?

A

We are blocked until ready

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

Is future first class?

A

yes

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

Is having too many threads bad?

A

Could be yes, as the time it takes to start x amount of threads can outweight the time of execution

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