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

Migrate from libsnooze #42

Merged
merged 9 commits into from
Oct 24, 2023
Merged

Migrate from libsnooze #42

merged 9 commits into from
Oct 24, 2023

Conversation

deavmi
Copy link
Owner

@deavmi deavmi commented Oct 1, 2023

Purpose

No longer want to use libsnooze. A condition variable with a mutex is safer with futex etc. Libsnooze had an FD and yeah, stuff could go wrong if a use closed those.

Todo ✍️

  • Receiver
    • Migrate to periodic wakeup mechanism with on-demand wait when blocked
  • Sender
    • Migrate to periodic wakeup mechanism with on-demand wait when blocked

- Removed `libsnooze` dependency
@deavmi deavmi added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 1, 2023
@deavmi deavmi self-assigned this Oct 1, 2023
- Removed libsnooze imports
- Removed libsnooze imports
- Removed import of `SnoozeError` from `libsnooze.exceptions`
@deavmi
Copy link
Owner Author

deavmi commented Oct 22, 2023

Will be working on this tomorrow. Shouldn't take more than 10 minutes (with testing included).

May just need to see if I want to add timeouts too.

- Calling `sq(ubyte[])` now will wake up the condition variable

Receiver

- Calling `rq(ubyte[])` now will wake up the condition variable
- Updated `recvHandlerFunc()` to use the condition variable
- Callind `end()` will wakeup the sleeping thread
- Calling `sq(ubyte[])` now will wake up the condition variable
- Updated `sendHandlerFunc()` to use the condition variable
- Callind `end()` will wakeup the sleeping thread
- Removed `SnoozeError` reference
@deavmi
Copy link
Owner Author

deavmi commented Oct 23, 2023

Migration done, rudimentary testing seems to show it works ✔️

@deavmi
Copy link
Owner Author

deavmi commented Oct 24, 2023

Looks good to me

@deavmi deavmi merged commit be5043c into master Oct 24, 2023
4 checks passed
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 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant