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

mailbox_receive: Add timeout #103

Open
perlun opened this issue Oct 8, 2017 · 0 comments
Open

mailbox_receive: Add timeout #103

perlun opened this issue Oct 8, 2017 · 0 comments

Comments

@perlun
Copy link
Contributor

perlun commented Oct 8, 2017

I've noted this while debugging #102; sometimes things can "stall" just because a threading is waiting on a mailbox that never gets populated.

The way to do it:

  • Record the timeout_timestamp_timeslice in mailbox_receive, in current_tss. If timeout is 0, it should fall back to the current behavior (wait indefinitely), which is actually desirable sometimes - the service mailbox for servers are the most typical case. The server wants to wait until it receives a connection request, even though that takes 7 days, 30 days or 365 days.
  • In the dispatcher, check if the current timeslice has reached the timeout_timestamp_timeslice. If so, unblock the thread and make mailbox_receive detect that the wait was aborted and return a return value to the caller indicating this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant