Tag: thread
4 posts
-
Kotlin Coroutines vs Threads: Cost, Dispatchers, Structured Concurrency and Cancellation
Comparison of Kotlin coroutines and OS threads: lightweight concurrency, memory overhead, scheduling, structured concurrency, Dispatchers.
-
C++ sleep_for vs sleep_until: Drift, Clock Choice and Cancellable Waits
How std::this_thread::sleep_for and sleep_until really behave: oversleeping, fixed-rate loops without drift, steady vs system clock, and waits you can cancel.
-
thread_local in C++: Per-Thread Caches and RNGs, Initialization Order and Pitfalls
C++11 thread_local: per-thread storage, caches, RNGs, initialization, and patterns without shared mutex overhead.
-
C++20 std::jthread: Auto-Join, Cooperative Cancellation with stop_token, and Its Limits
C++20 std::jthread explained: why std::thread terminates without join, how jthread requests stop and joins in its destructor, how stop_token, stop_callback, and condition_variable_any make waits cancellable, and the cases where auto-join still hangs.