jbrukh / bayesian

Naive Bayesian Classification for Golang.
Other
799 stars 128 forks source link

fix data race issue for Classifier.seen #13

Closed akrennmair closed 8 years ago

akrennmair commented 8 years ago

When running the LogScores method in a highly concurrent situation, I noticed that Go's data race detector would complain about a data race regarding Classifier.seen. So that's why I changed any read and write operation to that particular member of the struct to only use atomic load and increment functions.

jbrukh commented 8 years ago

Thank you for the contribution!