#include <iostream>
#include <thread>

using namespace std;

void thread1()
{
	while(true)
	{
		this_thread::sleep_for(chrono::milliseconds(300)); // Симуляция работы	
		// здесь нужна синхронизация с другими потоками
	}
}

void thread2()
{
	while(true)
	{
		this_thread::sleep_for(chrono::milliseconds(500)); // Симуляция работы
		// здесь нужна синхронизация с другими потоками
	}
}

int main()
{
	thread t1(thread1);
	thread t2(thread2);
	
	t1.detach();
	t2.detach();

	// thread 0
	while(true)
	{
		this_thread::sleep_for(chrono::milliseconds(100)); // Симуляция работы
		// здесь нужна синхронизация с другими потоками
	}
}