6.5.1

Concurrent Processing

Test yourself

Thinking Concurrently

Thinking concurrently involves solving different parts of a problem at the same time to improve efficiency.

Illustrative background for Determining concurrent parts of a problemIllustrative background for Determining concurrent parts of a problem ?? "content

Determining concurrent parts of a problem

  • When solving a problem, sometimes it can be split into smaller tasks that can be done at the same time.
    • This is called concurrency.
  • For example, imagine you are building a computer program to process customer orders.
    • One part of the program can handle the payment while another part checks the stock.
    • These two tasks do not need to wait for each other.
    • Both tasks can happen at the same time.
Illustrative background for Benefits of concurrent processingIllustrative background for Benefits of concurrent processing ?? "content

Benefits of concurrent processing

  • One benefit of concurrent processing is speed.
  • If multiple tasks are done at the same time, the job can be finished faster.
  • This is especially useful when tasks are independent of each other.
  • For example, when loading a web page, the browser can download images and text at the same time.
    • This makes the web page appear faster.
Illustrative background for Trade-offs of concurrent processingIllustrative background for Trade-offs of concurrent processing ?? "content

Trade-offs of concurrent processing

  • However, there are trade-offs when using concurrency.
  • If the tasks depend on each other, it can be tricky to manage them.
    • For example, if two parts of a program try to change the same file at the same time, there could be problems.
    • This is called a race condition.
  • Solving these problems can make the program more complicated.
Illustrative background for Choosing when to use concurrencyIllustrative background for Choosing when to use concurrency ?? "content

Choosing when to use concurrency

  • To decide if concurrency is a good idea, you must think about the problem.
    • If the tasks can be done at the same time without interfering with each other, concurrency will probably improve performance.
    • However, if the tasks depend on each other, concurrency might cause more problems than it solves.

Jump to other topics

1Components of a Computer

2Software & Software Development

3Exchanging Data

4Data Types, Data Structures & Algorithms

5Legal, Moral, Cultural & Ethical Issues

6Elements of Computational Thinking

6.1Thinking Abstractly

6.2Thinking Ahead

6.3Thinking Procedurally

6.4Thinking Logically

6.5Thinking Concurrently

7Problem Solving & Programming

8Algorithms

Unlock your full potential with Seneca Premium

  • Unlimited access to 10,000+ open-ended exam questions

  • Mini-mock exams based on your study history

  • Unlock 800+ premium courses & e-books

Get started with Seneca Premium