web UI added and refactoring done
This commit is contained in:
@@ -98,9 +98,12 @@ class ShmRingWriter:
|
||||
write_seq = self._read_u64(24)
|
||||
read_seq = self._read_u64(32)
|
||||
if max(0, write_seq - read_seq) >= self._capacity:
|
||||
self._write_u64(32, read_seq + 1)
|
||||
dropped = self._read_u64(40)
|
||||
self._write_u64(40, dropped + 1)
|
||||
# Advance the consumer cursor past the slot we are about to overwrite, but
|
||||
# re-read it first and move it only forward: a concurrent reader may have
|
||||
# already advanced it, and clobbering that backward would re-deliver an
|
||||
# already-consumed slot as a duplicate.
|
||||
self._write_u64(32, max(self._read_u64(32), read_seq + 1))
|
||||
self._write_u64(40, self._read_u64(40) + 1)
|
||||
|
||||
index = write_seq % self._capacity
|
||||
slot_offset = _HEADER_SIZE + index * (_SLOT_HEADER_SIZE + self._slot_size_bytes)
|
||||
|
||||
Reference in New Issue
Block a user