Skip to content
  • Longpeng (Mike)'s avatar
    f9fc8932
    thread-posix: remove the posix semaphore support · f9fc8932
    Longpeng (Mike) authored
    
    
    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 any more.
    
    An alternative way is to use sem_trywait + usleep, maybe we can
    remove CONFIG_SEM_TIMEDWAIT in this way? No, because some systems
    (e.g. mac os) mark the sem_xxx API as deprecated.
    
    So maybe remove the usage of POSIX semaphore and turn to use the
    pthread variant for all systems looks better.
    
    Signed-off-by: default avatarLongpeng(Mike) <longpeng2@huawei.com>
    Message-Id: <20220222090507.2028-2-longpeng2@huawei.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    f9fc8932
    thread-posix: remove the posix semaphore support
    Longpeng (Mike) authored
    
    
    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 any more.
    
    An alternative way is to use sem_trywait + usleep, maybe we can
    remove CONFIG_SEM_TIMEDWAIT in this way? No, because some systems
    (e.g. mac os) mark the sem_xxx API as deprecated.
    
    So maybe remove the usage of POSIX semaphore and turn to use the
    pthread variant for all systems looks better.
    
    Signed-off-by: default avatarLongpeng(Mike) <longpeng2@huawei.com>
    Message-Id: <20220222090507.2028-2-longpeng2@huawei.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Loading