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

Add usrsctp_get_timeout() #591

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oleavr
Copy link
Contributor

@oleavr oleavr commented May 21, 2021

To improve energy efficiency when integrating with an event loop.

This could also be used internally for the timer thread, to improve on the current behavior where this thread wakes up every 10 ms.

@oleavr
Copy link
Contributor Author

oleavr commented May 21, 2021

Oops, should obviously be finding the minimum delta, not the maximum. Need more coffee! 😅 Fixing.

To improve energy efficiency when integrating with an event loop.
@oleavr
Copy link
Contributor Author

oleavr commented May 21, 2021

Fixed.

@ibc
Copy link

ibc commented Feb 13, 2023

@tuexen any chance for this PR to be reviewed? It makes lot of sense.

@jmillan
Copy link
Contributor

jmillan commented Feb 14, 2023

Wow, I didn't see this before. This looks like an epic performance and energy improvement!

@jmillan
Copy link
Contributor

jmillan commented May 18, 2023

@oleavr , would you please provide some detailed description about the improvements this change provides?

@tuexen , friendly ping about this nice enhancement.

@jmillan
Copy link
Contributor

jmillan commented Nov 18, 2023

To improve energy efficiency when integrating with an event loop.

Even a better approach, when integrating with an even loop, would be being able to assign an event file descriptor (eventfd()) to a usrsctp socket, so usrsctp writes into the event fd anytime there is something to read/write and the application can poll the event fd to get notified about such changes made by the library.

This way there would be an alternative to timers, and the app would be notified by the event loop only when there is something to be done.

EDIT;

Perhaps that is something that can be achieved with usrsctp_set_upcall(), @tuexen? Does this API call the given callback when there is something to read or write?

ibc added a commit to versatica/usrsctp that referenced this pull request Mar 5, 2024
Same as PR sctplab#591 by @oleavr in upstream project which has been ignored for 4 years.

A little change: Instead of using `int` to hold a `uint32_t` (or -1) let's use a `int64_t`.
@Lynnworld
Copy link

Would it be possible to merge this pull request, @tuexen ? It appears to be quite beneficial.

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.

4 participants