Visit here for explanations.
In terminal A (also for the two belows)
ros2 run simple_thread_tester publisher_node
In terminal B
ros2 run simple_thread_tester single_thread_subscriber_node
ros2 run simple_thread_tester multi_thread_reentrant_subscriber_node
ros2 run simple_thread_tester multi_thread_reentrant_subscriber_node
# If simulate mutex
ros2 param set /subscriber_node use_mutex true