# Concurrency

Tasks are lightweight and run on the VM's schedulers, one per logical core by default, so they use several CPU cores and overlap while they wait for I/O or a timer. Their order is not fixed; `--schedulers 1` runs one task at a time. The tour page [Tasks](https://www.agentica-lang.com/agentica/tour/tasks/index.md) is a short start.

- Use [Task](https://www.agentica-lang.com/agentica/library/concurrency/task/index.md) to run work at the same time: start, await, pause and cancel tasks.
- Use a [Channel](https://www.agentica-lang.com/agentica/library/concurrency/channel/index.md) to pass values between tasks. A producer sends and a consumer receives.
- Use an [ATS](https://www.agentica-lang.com/agentica/library/concurrency/ats/index.md) table to share a counter or a cache that tasks update in place.
- Use [Cache](https://www.agentica-lang.com/agentica/library/concurrency/cache/index.md) (`std/cache`) to keep computed text that tasks share, within a byte budget.
- Use an [Actor](https://www.agentica-lang.com/agentica/library/concurrency/actor/index.md) (`std/actor`) for state that one task owns and other tasks reach with `cast` and `call`.
- Use a [Supervisor](https://www.agentica-lang.com/agentica/library/concurrency/supervisor/index.md) (`std/supervisor`) to start actors and start again one that crashes.

## Pages in this section

- [Task](https://www.agentica-lang.com/agentica/library/concurrency/task/index.md): Start, await (with or without a timeout), pause, cancel, monitor and count lightweight tasks, map a block over a list with bounded concurrency, hand a handle to a task, and find their crashes.
- [Channel](https://www.agentica-lang.com/agentica/library/concurrency/channel/index.md): Send values from one task to another through a bounded queue.
- [ATS](https://www.agentica-lang.com/agentica/library/concurrency/ats/index.md): Share a counter or a cache between tasks in one mutable table.
- [Cache (std)](https://www.agentica-lang.com/agentica/library/concurrency/cache/index.md): The std/cache module, a small contract for caches of strings that tasks share, and an in-memory implementation of it built on ATS.
- [Actor (std)](https://www.agentica-lang.com/agentica/library/concurrency/actor/index.md): The std/actor module, a task that owns its state and handles the messages of one inbox, with cast, call, send and await, stop and a receive timeout.
- [Supervisor (std)](https://www.agentica-lang.com/agentica/library/concurrency/supervisor/index.md): The std/supervisor module, a task that starts actors and starts again one that crashes, one for one, within a restart limit.
