Skip to content

1.5.0

Choose a tag to compare

@krylosov-aa krylosov-aa released this 17 Jan 21:40

Fixed the data race when updating host status. There are no longer two buffers and a status pointer; instead, there's now a single atomic status field. Since it consists of just four bool values, it occupies only 4 bytes and is therefore lock-free.

The writer atomically updates the status of each host. Readers atomically load the status and can continue working with their local copy as long as needed. Atomic operations are now relaxed, since synchronization with non-atomic data is no longer required.

The only downside of this approach which I don't consider critical for this project is temporary inconsistency while the writer is updating all hosts: some hosts may already have the new data, while others still have the old data.