-
Notifications
You must be signed in to change notification settings - Fork 75
fix: make timestamps strictly increasing #201
Conversation
On Linux, this is almost always the case. Windows, however, doesn't have nanosecond accuracy. We make the timestamp sequence numbers strictly increasing by returning the last timestamp + 1 where necessary.
ccdc39e
to
add0c9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I searched all locally checked out code and all of GitHub, and it looks like
TimestampSeq
isn't used anywhere. Would removing it be an option? - I find the three atomic operations really hard to reason about. A mutex would be a lot simpler.
It's used by the
Hm. Yeah, that's probably fine. This is definitely not a hotspot. |
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
83f730d
to
7a741a9
Compare
I meant outside of the repo. There's no real reason to export it. But I'm ok with not changing that (in this PR at least). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a lot easier to read, thanks!
Ah. I see... Yeah, probably. But no energy. |
On Linux, this is almost always the case. Windows, however, doesn't have nanosecond accuracy.
We make the timestamp sequence numbers strictly increasing by returning the last timestamp + 1 where necessary.