Tour of Registers

User Space Thead in C++

This is a series of blogs exploring the implementation of User Space Thread in C++. A user-space thread is managed by the userspace code with very minimal involvement of the Kernel APIs. This blog will not discuss the pros and cons of User Space Thread, nevertheless, you might want to check this. I believe that knowing the machinery of User Space Thread implementation will help us to understand the new Coroutine feature released in C++20 (Talk from cppcon 2015). [Read More]

Cpp chronicle #1

Joinable and interruptible thread in C++20

What are some of the problems with the std::thread ? The following program will cause core dump. /* gcc version 10.0.1 20200314 (experimental) (GCC) Ubuntu 18.04.5 LTS x86_64 GNU/Linux 5.6.2 */ #include <thread>#include <iostream> int main() { std::thread t{[]() { std::cout <<"Hello from thread t"<<std::endl; }}; } The reason for the core dump is std::terminate() called by the destructor of the std::thread object t. // from std::thread header ~thread() { if (joinable()) std::terminate(); } The default terminate handler calls abort. [Read More]
c++  thread