[Top][All Lists]

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

Re: [Qemu-devel] [RFC PATCH] tests: replace rem = sleep(time) with g_tim

From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH] tests: replace rem = sleep(time) with g_timer
Date: Fri, 11 Jan 2019 15:43:30 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1

On 11/01/19 15:38, Alex Bennée wrote:
> Relying on sleep to always return having slept isn't safe as a signal
> may have occurred. If signals are constantly incoming the program will
> never reach it's termination condition. This is believed to be the
> mechanism causing time outs for qht-test in Travis.
> Instead we use a g_timer to determine if the duration of the test has
> passed and sleep for a second at a time. This may bias benchmark
> results for short runs.

Why not g_usleep?  It already does a while loop around nanosleep (which
returns the remaining time in the wait, like select but unlike sleep and



reply via email to

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