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

Are writes ordered? #29

Closed
ronag opened this issue Apr 25, 2022 · 4 comments
Closed

Are writes ordered? #29

ronag opened this issue Apr 25, 2022 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@ronag
Copy link
Contributor

ronag commented Apr 25, 2022

I see that we are using napi_create_async_work. However, I can't read anywhere whether or not work items are guaranteed to be executed in order or not. If not then we might have a problem with write ordering, i.e. preceding writes overwriting following writes.

Do we need to create our own per db ordered work queue?

@vweevers
Copy link
Member

vweevers commented May 1, 2022

Writes are not ordered (at least by design, and I doubt that napi_create_async_work is ordered, seeing as its purpose is parallel work). For the majority of users that's perfectly fine. Introducing a work queue would be a major change, and quite complicated, so I want to see many upvotes before considering it. Until then it can be handled in userland, where you have a choice of doing things in parallel or sequentially.

@ronag
Copy link
Contributor Author

ronag commented May 1, 2022

I think we might need to add a clear warning for this in the docs. I for one assumed that they would be ordered.

@vweevers
Copy link
Member

vweevers commented May 1, 2022

That would be good. PR welcome.

@vweevers vweevers added the documentation Improvements or additions to documentation label May 1, 2022
@vweevers
Copy link
Member

vweevers commented Oct 1, 2022

Done as part of Level/abstract-level#42.

@vweevers vweevers closed this as completed Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants