Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the system clock guarantee in-order responses? #9

Open
danlentz opened this issue Sep 27, 2024 · 1 comment
Open

Does the system clock guarantee in-order responses? #9

danlentz opened this issue Sep 27, 2024 · 1 comment

Comments

@danlentz
Copy link

Just asking out of curiosity, as when working updating clj-uuid for rfc-9562 I noticed that, even in a single thread, I could generate enough calls that I would eventually receive out-of-order clock times.

uuid/uuid.lisp

Line 143 in f0052f3

(cond ((not (= last-time time-now))

if so, mitigating this would require just a small additional clause:

((> last-time time-now)
  (sleep 0.0001)
  (go restart))

Similarly to here https://github.com/danlentz/clj-uuid/blob/master/src/clj_uuid/clock.clj#L68

Cheers!

@danlentz
Copy link
Author

well, ok, the sleep 0.0001 in your loop probably helps avoid this happening in practice for single threaded. (and we're not worrying about multiple threads here). But, anyways, just passing along the experience, as it was a tricky one to figure out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant