add some time between thread creation

This commit is contained in:
Christian Giese
2022-11-02 17:52:51 +01:00
committed by Christian Giese
parent 7524732fb7
commit f034105173
+4
View File
@@ -285,10 +285,14 @@ void
io_thread_start_all()
{
io_thread_s *thread = g_ctx->io_threads;
struct timespec sleep, rem;
sleep.tv_nsec = 7800179; /* prime number betwen 7 and 8ms */
while(thread) {
thread->active = true;
timer_smear_all_buckets(&thread->timer.root);
pthread_create(&thread->thread, NULL, io_thread_main, (void *)thread);
nanosleep(&sleep, &rem);
thread = thread->next;
}
}