Lecture 7 - Channels & Packaged Tasks Flashcards

1
Q

What is the name of the channel between an async task and a future?

A

a promise

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

Can we obtain the future from a promise?

A

YEs

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

What do we need to do with a promise?

A

Assign it to a task, it has to be owned

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

What do promises help us do?

A

Synchronise tasks, as we can wait from a promise to get future. We can explicitly write a value back to calling thread

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

What is std::packaged_task

A

Wrapping a task for future execution, it can be treated as first class.

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

How is a std::packaged_task started?

A

Assigning the task to a thread and joining to current thread.

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