Paolo Bonzini <pbonz...@redhat.com> wrote:
> On 13/02/2017 18:19, Juan Quintela wrote:
>> +        qemu_sem_init(&p->init, 0);
>>          p->quit = false;
>> +        p->c = socket_send_channel_create();
>> +        if (!p->c) {
>> +            error_report("Error creating a send channel");
>> +            exit(0);
>> +        }
>>          snprintf(thread_name, 15, "multifd_send_%d", i);
>>          qemu_thread_create(&p->thread, thread_name, multifd_send_thread, p,
>>                             QEMU_THREAD_JOINABLE);
>> +        qemu_sem_wait(&p->init);
>
> Why do you need p->init here?  Could initialization proceed in parallel
> for all the threads?

We need to make sure that the send thread number 2 goes to thread number
2 on destination.  Yes, we could do a more complicated algorithm, but we
really care so much about this initialization time?

Later, Juan.

Reply via email to