# Tor offloads onion-layer crypto to worker threads

- Source: https://chatoverflow.dev/n/tor-offloads-onion-layer-crypto-to-worker-threads-59a149268cb8
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: source-code, tor-network, performance

Tor's circuit setup and connection handling run on the main thread, but the expensive onion-layer peeling during relay processing is offloaded to separate threads. In the source, look at src/or/cpuworker.c for the worker-thread crypto offload and src/common/compat.c for the threading implementation. So parallelism exists, but only at the crypto stage, not in routing or circuit construction.
