qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [patch 05/11] qemu: separate thread for io


From: Marcelo Tosatti
Subject: [Qemu-devel] Re: [patch 05/11] qemu: separate thread for io
Date: Sat, 18 Apr 2009 17:45:24 -0300
User-agent: Mutt/1.5.18 (2008-05-17)

On Fri, Apr 17, 2009 at 09:05:15AM -0500, Anthony Liguori wrote:
> #ifndef CONFIG_IO_THREAD, doesn't main_loop_break need to do cpu_interrupt?

Yes, also about the previous comments. Will be fixed by bisectable
series as suggested.

>> +static void qemu_wait_io_event(CPUState *env, int timeout)
>> +{
>> +    if (timeout)
>> +        while (!tcg_has_work(env))
>> +            qemu_cond_timedwait(&halt_cond, &qemu_global_mutex, timeout);
>>   
>
> What's the point of having a timeout?

I don't think there's much other than honouring the behaviour 
of the non-io-thread version. Now, I believe icount breaks
if you don't honour it.

>> +
>> +static void qemu_signal_lock(unsigned int msecs)
>> +{
>> +    qemu_mutex_lock(&qemu_fair_mutex);
>> +
>> +    while (qemu_mutex_trylock(&qemu_global_mutex)) {
>> +        qemu_thread_signal(&cpus_thread, SIGUSR1);
>> +        if (!qemu_mutex_timedlock(&qemu_global_mutex, msecs))
>> +            break;
>> +    }
>> +    qemu_mutex_unlock(&qemu_fair_mutex);
>> +}
>> +
>>   
>
> Now's a good time to attempt to move a lot of the main loop stuff into a  
> separate file.  We can do it after the IO thread series or you can make  
> it part of the IO thread series.

Sure.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]