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

We have a tool to run a body only once, use it #17

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

aredington
Copy link
Collaborator

dosync does not create an exclusion context on executing its body, so it's possible for two threads to enter the dosync and try to run eval-fn independently. Only one of them will win and get into ref-map, but there's still two outbound requests. This is bad.

Delay actually promises exactly once execution and deferred execution, which are the two things we want. Makes sure that locks are localized on individual bodies and we don't e.g. lock on the entire map.

This is aimed as resolving @joaopluigi 's reported problem of requests firing multiple times.

Copy link
Collaborator

@sovelten sovelten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add changelog and bump project version

`dosync` does not create an exclusion context on executing its body,
so it's possible for two threads to enter the `dosync` and try to run
`eval-fn` independently. Only one of them will win and get into
`ref-map`, but there's still two outbound requests. This is bad.

Delay actually promises exactly once execution and deferred execution,
which are the two things we want. Makes sure that locks are localized
on individual bodies and we don't e.g. lock on the entire map.
@aredington aredington force-pushed the dont-run-leafs-twice branch from d1df2be to 40f9256 Compare December 5, 2023 21:07
@aredington aredington merged commit 8da600d into main Dec 5, 2023
4 checks passed
@aredington aredington deleted the dont-run-leafs-twice branch December 5, 2023 21:48
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

Successfully merging this pull request may close these issues.

3 participants