You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each accepted connection is currently handled by a std::thread. We can use C++20 now, which offers std::jthread. In addition to the resource management benefits, it also supports cooperative cancellation (stop_token) which should improve the way interruption of connections is handled (i.e., Ctrl-C is passed and the threads need to go away swiftly).
In short, we should consider using:
jthread
std::stop_source/token with the jthreads.
std::condition_variable_any with the std::stop_token
The text was updated successfully, but these errors were encountered:
Each accepted connection is currently handled by a std::thread. We can use C++20 now, which offers std::jthread. In addition to the resource management benefits, it also supports cooperative cancellation (stop_token) which should improve the way interruption of connections is handled (i.e., Ctrl-C is passed and the threads need to go away swiftly).
In short, we should consider using:
The text was updated successfully, but these errors were encountered: