Re: [RFC 1/2] sem-posix: remove the posix semaphore support

2022-02-23 Thread Paolo Bonzini
On 2/21/22 12:11, Daniel P. Berrangé wrote: As a point of history, the original code only used sem_t. The pthreads based fallback was introduced by Paolo in commit c166cb72f1676855816340666c3b618beef4b976 Author: Paolo Bonzini Date: Fri Nov 2 15:43:21 2012 +0100 semaphore: imp

RE: [RFC 1/2] sem-posix: remove the posix semaphore support

2022-02-21 Thread longpeng2--- via
; Gonglei > (Arei) > > Subject: Re: [RFC 1/2] sem-posix: remove the posix semaphore support > > On Mon, Feb 21, 2022 at 05:56:16PM +0800, Longpeng(Mike) via wrote: > > POSIX specifies an absolute time for sem_timedwait(), it would be > > affected if the system time is chan

Re: [RFC 1/2] sem-posix: remove the posix semaphore support

2022-02-21 Thread Daniel P . Berrangé
On Mon, Feb 21, 2022 at 05:56:16PM +0800, Longpeng(Mike) via wrote: > POSIX specifies an absolute time for sem_timedwait(), it would be > affected if the system time is changing, but there is not a relative > time or monotonic clock version of sem_timedwait, so we cannot gain > from POSIX semaphore

[RFC 1/2] sem-posix: remove the posix semaphore support

2022-02-21 Thread Longpeng(Mike)
POSIX specifies an absolute time for sem_timedwait(), it would be affected if the system time is changing, but there is not a relative time or monotonic clock version of sem_timedwait, so we cannot gain from POSIX semaphore anymore. An alternative way is to use sem_trywait + usleep, maybe we can r