C++20 Concurrency: part-3 request_stop and stop_token for std::jthread

Gajendra Gulgulia
7 min readJan 12, 2022

In this article, we explore the latest feature of C++20’s std::jthreadthat allows one to signal a stop or cancellation to an already executing thread in certain situation. Quoting the first line again from cpp reference:

the class jthread represents a single thread of execution … , and can be cancelled/stopped in certain situations.

--

--