pureikyubu/RnD/ThreadDemo
2020-08-09 17:59:07 +03:00
..
.gitignore ThreadDemo Ubuntu 2020-08-09 15:50:01 +03:00
CMakeLists.txt ThreadDemo Ubuntu 2020-08-09 15:50:01 +03:00
pch.cpp ThreadDemo 2020-08-09 15:17:46 +03:00
pch.h ThreadDemo Ubuntu 2020-08-09 15:50:01 +03:00
Readme.md Threads on Linux 2020-08-09 17:59:07 +03:00
ThreadDemo.cpp Threads on Linux 2020-08-09 17:59:07 +03:00
ThreadDemo.jpg ThreadDemo 2020-08-09 15:17:46 +03:00
ThreadDemo.sln ThreadDemo 2020-08-09 15:17:46 +03:00
ThreadDemo.vcxproj ThreadDemo Ubuntu 2020-08-09 15:50:01 +03:00
ThreadDemo.vcxproj.filters ThreadDemo Ubuntu 2020-08-09 15:50:01 +03:00

ThreadDemo

Demonstration of working with threads.

JPG

Mutual-exclusive syncronization

Two threads (Boy1, Boy2) take turns occupying the spinlock (Girl) and use it for 100 ms.

The main thread waits 2000ms and exits both threads.

Suspend/Resume

One thread is periodically resumed (once per 1/2 second) for spam messages. After 10 seconds thread is destroyed.