default actions to signals
- almost all signals in POSIX. 1-1900, the default is to terminate without or with core dump.
- few signals are ignored like SIGCHLD
- SIGSTOP cause the program to suspend and SIGCONT to continue. common situation is use
CTRL-Z
in shell
c++11 threads
Eli Bendersky's website: C++11 threads, affinity and hyperthreading
c++11 thread_local
目前使用编译器的选项设置:windows:*__declspec(thread)* linux: *__thread*
使用recursive_mutex问题
task A wants to modify a shared data structure and take a lock on its recursive mutex. It then blocks on some OS call; the task gets taken off current thread, and task B start executing. task B take a lock on the same recursive mutex successfully because it executed on the same thread, then it will reads or modify the data which was in the middle of being modified by task A, then a disaster happen!