Skip to content

Commit

Permalink
gconsurrent:fast,thread-safe
Browse files Browse the repository at this point in the history
  • Loading branch information
miniLCT committed Apr 7, 2024
1 parent 19933c9 commit 4ec82c0
Show file tree
Hide file tree
Showing 15 changed files with 1,973 additions and 41 deletions.
1 change: 1 addition & 0 deletions gogenerics/constraints/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
)

// AtomicError defines an atomic error.

type AtomicError struct {
err atomic.Value // error
}
Expand Down
10 changes: 2 additions & 8 deletions gogenerics/constraints/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ func BenchmarkAtomicError(b *testing.B) {
b.Run("Load", func(b *testing.B) {
var done uint32
go func() {
for {
if atomic.LoadUint32(&done) != 0 {
break
}
for atomic.LoadUint32(&done) == 0 {
wg.Add(1)
go func() {
aerr.Set(errDummy)
Expand All @@ -62,10 +59,7 @@ func BenchmarkAtomicError(b *testing.B) {
b.Run("Set", func(b *testing.B) {
var done uint32
go func() {
for {
if atomic.LoadUint32(&done) != 0 {
break
}
for atomic.LoadUint32(&done) == 0 {
wg.Add(1)
go func() {
_ = aerr.Load()
Expand Down
2 changes: 2 additions & 0 deletions gogenerics/gconcurrent/mapx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# mapx
mapx is the thread-safe and high perf map implementation for golang.
Loading

0 comments on commit 4ec82c0

Please sign in to comment.