Skip to content

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