[Qemu-devel] [PATCH 09/16] qemu-thread: introduce QemuLockCnt

2016-02-09 Thread Paolo Bonzini
A QemuLockCnt comprises a counter and a mutex, with primitives to increment and decrement the counter, and to take and release the mutex. It can be used to do lock-free visits to a data structure whenever mutexes would be too heavy-weight and the critical section is too long for RCU. This could b

Re: [Qemu-devel] [PATCH 09/16] qemu-thread: introduce QemuLockCnt

2016-02-08 Thread Eric Blake
On 02/08/2016 09:15 AM, Paolo Bonzini wrote: > A QemuLockCnt comprises a counter and a mutex, with primitives > to increment and decrement the counter, and to take and release the > mutex. It can be used to do lock-free visits to a data structure > whenever mutexes would be too heavy-weight and th

[Qemu-devel] [PATCH 09/16] qemu-thread: introduce QemuLockCnt

2016-02-08 Thread Paolo Bonzini
A QemuLockCnt comprises a counter and a mutex, with primitives to increment and decrement the counter, and to take and release the mutex. It can be used to do lock-free visits to a data structure whenever mutexes would be too heavy-weight and the critical section is too long for RCU. This could b

[Qemu-devel] [PATCH 09/16] qemu-thread: introduce QemuLockCnt

2016-01-15 Thread Paolo Bonzini
A QemuLockCnt comprises a counter and a mutex, with primitives to increment and decrement the counter, and to take and release the mutex. It can be used to do lock-free visits to a data structure whenever mutexes would be too heavy-weight and the critical section is too long for RCU. This could b