Hi Alexandre, > If this seems acceptable, the next steps could be ...
I don't think this design works. Rooms change the semantics of an LWLock: exclusive access no longer excludes all other holders. Data access needs to be reworked to support this. The buffer mapping access in this patch already has a problem: different rooms in the same partition can map to the same hash bucket, allowing concurrent modifications to its chain and causing entries to be lost. In 0001, releasing the last room while LW_FLAG_WAKE_IN_PROGRESS is set leaves LW_EXCLUSIVE set. Shared waiters cannot clear it and remain blocked forever unless a subsequent exclusive acquisition and release clears it. This also affects ordinary LW_EXCLUSIVE acquisitions. All 26 rooms share one state word. Acquirers of disjoint rooms still CAS on the same cache line, so the scalability bottleneck remains and may even get worse. In this case, I would increase NUM_BUFFER_PARTITIONS. Best regards, Yuhang Qiu
