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

Data Race #2

Open
djherbis opened this issue Jul 18, 2016 · 2 comments
Open

Data Race #2

djherbis opened this issue Jul 18, 2016 · 2 comments

Comments

@djherbis
Copy link

Looks like you are reading/writing to the status variable concurrently from two different goroutines

Read:

fast/fast.go

Line 24 in cd978a0

fmt.Printf("\r %s %s", spinner.Spin(), status)

Write:

fast/fast.go

Line 56 in cd978a0

status = format(Kbps) + " "

You can use the race detector to help:
https://golang.org/doc/articles/race_detector.html#Introduction

@djherbis
Copy link
Author

You might consider using the select statement on the ticker and KbpsChan to make sure the reads/writes are synchronized.

@ddo
Copy link
Owner

ddo commented Jul 18, 2016

@djherbis ty i will check asap

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

2 participants