fast icon indicating copy to clipboard operation
fast copied to clipboard

Data Race

Open djherbis opened this issue 7 years ago • 2 comments

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

Read: https://github.com/ddo/fast/blob/cd978a0251d02954785e4bc49a21450a35743a80/fast.go#L24

Write: https://github.com/ddo/fast/blob/cd978a0251d02954785e4bc49a21450a35743a80/fast.go#L56

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

djherbis avatar Jul 18 '16 16:07 djherbis

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

djherbis avatar Jul 18 '16 16:07 djherbis

@djherbis ty i will check asap

ddo avatar Jul 18 '16 16:07 ddo