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

Race condition in startup logic #2

Open
joonas-fi opened this issue May 16, 2021 · 0 comments
Open

Race condition in startup logic #2

joonas-fi opened this issue May 16, 2021 · 0 comments

Comments

@joonas-fi
Copy link

These things happen in chronological order:

  1. Processors are started
    • incomingProcessor() and outgoingProcessor() are started as goroutines (which stop if znp.started == false)
  2. znp.started = true

The logic works because I guess, starting goroutines usually runs a bit later than the code following the goroutine launch. This is / should be an implementation detail of Go's runtime and should not be relied on. Who knows if on a slower processor or busier system these are executed in different order.

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

No branches or pull requests

1 participant