Re: Restart pg_usleep when interrupted - Mailing list pgsql-hackers

From Sami Imseih
Subject Re: Restart pg_usleep when interrupted
Date
Msg-id D1558DDA-CEED-4CED-B3ED-C425D996FCA3@gmail.com
Whole thread Raw
In response to Re: Restart pg_usleep when interrupted  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: Restart pg_usleep when interrupted
List pgsql-hackers

> 
> On Wed, Aug 07, 2024 at 06:00:53AM +0000, Bertrand Drouvot wrote:
>> +        SleepEx((microsec < 500 ? 1 : (microsec + 500) / 1000), FALSE);
> 
> I think this deserves a comment.
> 

Done

>> +#define INSTR_TIME_ADD_MICROSEC(x,t) \
>> +    ((x).ticks += t * NS_PER_US)
> 
> I'd add parentheses around "t" to ensure any expressions given as "t" are
> evaluated first.
> 

Done


> Also, do we need to worry about overflow here?  It looks like the rest of
> instr_time.h is oblivious about overflow, so maybe this is better discussed
> in a separate thread...
> 

I agree, this needs to be handled in a different thread.

Please see v7.


Regards,

Sami
Attachment

pgsql-hackers by date:

Previous
From: Paul Jungwirth
Date:
Subject: Re: SQL:2011 application time
Next
From: Nathan Bossart
Date:
Subject: Re: New GUC autovacuum_max_threshold ?