2.1.5 - Thinking Concurrently Flashcards

Component 2

1
Q

What is concurrent processing?

A

Carrying out more than one process at a time (overlapping)

Where one process does not have to finish before the other starts

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

How might tree traversal use concurrent processing?

A

Apply different searches simultaneously: perform breadth-first and depth-first searches simultaneously.

Searching a tree: rather than going down 1 path, go down 2+

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

How might a linear search use concurrent processing?

A

Can have multiple processors searching different areas at the same time.

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

How might a binary search use concurrent processing?

A

It cannot - it is not parallelizable.

The next move depends on the outcome of checking the mid-point.

This algorithm does not benefit from using multiple processors.

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

How might a cinema booking system use concurrent processing?

A

Multiple orders happening at the same time.

Record locking used to stop double bookings

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

What are the trade-offs if you use concurrent processing?

A

Locking will be needed meaning more complex programming (prevents two processes from updating the same thing)

Not all the processes will be able to be done in parallel (parallelizable).

Cannot be done when the current stage depends on the previous stage.
X processors don’t mean it will run in 1/xth of the time of one processor.

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