openskills.info
Course Preview

Concurrency Fundamentals

Concurrency is the structuring of a program so that multiple tasks can make progress within overlapping time periods. It covers threads, synchronization primitives, race conditions, deadlocks, and the models programmers use to coordinate shared mutable state safely.

itComputer fundamentals

Concurrency Fundamentals

Concurrency lets a program manage several independent activities whose lifetimes overlap. Parallelism means computations execute at the same instant. A concurrent program can run on one processor by taking turns. A parallel program needs execution capacity for work to run simultaneously.

You meet concurrency whenever software must remain responsive while waiting, serve many requests, process background jobs, or use several processor cores. The benefit is not automatic speed. Concurrency gives you a way to structure overlapping work. Parallelism can reduce elapsed time when the work and hardware allow it.

The central difficulty is order. A single sequence of instructions has one obvious next step. Concurrent tasks can interleave in several valid orders. Your design must remain correct for every order the runtime permits, not only the order you saw during one test.

Units of concurrent work

A process is a running program with its own operating-system resources and address space. A thread is an execution path within a process. Threads in one process commonly share memory. A runtime may also offer lighter units such as tasks, futures, coroutines, or goroutines.

An asynchronous task can pause while it waits and let other tasks use the same thread. This cooperative style works well for workloads with many waits, such as network services. A task must reach an await or another yield point before peer tasks can run on that event-loop thread.

Continue the course

This section is part of the paid course.

See pricing to subscribe, or log in if you already have access.

Sources

  • https://go.dev/blog/waza-talk
  • https://go.dev/ref/mem
  • https://docs.oracle.com/javase/specs/jls/se26/html/jls-17.html
  • https://doc.rust-lang.org/book/ch16-01-threads.html
  • https://doc.rust-lang.org/book/ch16-02-message-passing.html
  • https://doc.rust-lang.org/book/ch16-03-shared-state.html
  • https://docs.python.org/3/library/asyncio-task.html
  • https://docs.python.org/3/library/asyncio-queue.html
  • https://docs.python.org/3/library/concurrent.futures.html
  • https://go.dev/doc/articles/race_detector