Skip to content

Validate frequency being deallocated #1

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

Closed
wants to merge 1 commit into from

Conversation

derek121
Copy link

Don't add Freq to Free if it wasn't actually in Allocated.
Alternatively, could be stricter and fail rather than silently ignoring.

I'd submitted a PR to the O'Reilly repo a while back, and was reminded of it by your tweet today

Don't add Freq to Free if it wasn't actually in Allocated.
Alternatively, could be stricter and fail rather than silently ignoring.
@francescoc
Copy link
Owner

We do this only for the Error handling section when a race condition can occur after linking to the client process.If the process terminates, we check if a frequency is associated to this process. If so, it is freed. Race conditions can happen, as the process can free the frequency and then terminate before the server handles the request.

The case you suggest is as a result of a corrupt state. We decided not to handle all of these border line cases, as they would have made the example more complicated, loosing focus on what we were trying to explain.

@francescoc francescoc closed this Jun 29, 2015
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