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

Mpsc update #162

Merged
merged 2 commits into from
Dec 2, 2024
Merged

Mpsc update #162

merged 2 commits into from
Dec 2, 2024

Conversation

lyrm
Copy link
Collaborator

@lyrm lyrm commented Nov 19, 2024

The mpsc queue has been updated to align with the code in Eio. Previously, it was based on an mpmc (multi-producer, multi-consumer) queue, but the new implementation leverages the fact that there is only one consumer.

Important Note: This change limits the usage of the is_empty and close functions, which can now only be called by the consumer.

Changes Made:

  • Updated the implementation to match the new Eio version.
  • Removed non-functional QCheck tests (close can not be called by a producer).
  • Added a drop_exn function
  • Added push_all and of_list functions
  • Renamed pop and peek pop_exn and peek_exn respectively
  • Updated STM tests to reflect the new behavior.
  • Revised the documentation to include the new limitations and features.

Note: use of a backoff seems to not improve performance.

@lyrm lyrm force-pushed the mpsc_update branch 3 times, most recently from 43687e1 to 19f1dcc Compare November 23, 2024 16:23
@lyrm
Copy link
Collaborator Author

lyrm commented Nov 23, 2024

@art-w : this is ready to review.

@lyrm lyrm force-pushed the mpsc_update branch 4 times, most recently from b5fa0a1 to 7b9200c Compare November 26, 2024 19:32
Copy link
Contributor

@art-w art-w left a comment

Choose a reason for hiding this comment

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

LGTM!

lyrm added 2 commits December 2, 2024 13:31
* Add bench

* Improve documentation

* Add of_list and push_all functions

* Add examples in documentation.

* More dscheck tests
@lyrm lyrm merged commit fba29af into ocaml-multicore:main Dec 2, 2024
6 checks passed
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.

2 participants