diff options
author | Jacob Vosmaer (GitLab) <jacob@gitlab.com> | 2018-04-06 11:04:25 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2018-04-06 11:04:25 +0300 |
commit | 4dadabad50b7821ee625166b8824b69b25a3221f (patch) | |
tree | 537cd5cae60ee948a73178f47cc2ff39dd1e092e /STYLE.md | |
parent | 5afd6a821d5530c4fcd244fec0c8b534f2387756 (diff) |
Don't use sync/atomic
Diffstat (limited to 'STYLE.md')
-rw-r--r-- | STYLE.md | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -107,4 +107,15 @@ instead of: func (server) GetBlob(_ *pb.GetBlobRequest, _ pb.BlobService_GetBlobServer) error { return helper.Unimplemented } -```
\ No newline at end of file +``` + +## Concurrency + +The [documentation of "sync/atomic"](https://golang.org/pkg/sync/atomic/) says: + +> These functions require great care to be used correctly. Except for +special, low-level applications, synchronization is better done with +channels or the facilities of the sync package. + +Gitaly is not a low-level application so we should avoid "sync/atomic". +We use channels and [package "sync"](https://golang.org/pkg/sync/). |