-
Notifications
You must be signed in to change notification settings - Fork 54
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
race-condition-pointers.go örneği, atomic kullanılarak fix edildi #12
base: main
Are you sure you want to change the base?
race-condition-pointers.go örneği, atomic kullanılarak fix edildi #12
Conversation
func increment(rt *RaceTest, wg *sync.WaitGroup) { | ||
atomic.AddInt32(&rt.Val, 1) | ||
wg.Done() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
atomic ornegi guzel olmus, aynisini farkli baska bir fonksiyonda mutex ile ornegini yapip aralarinda benchmark uyguladigimiz bir test eklesek nasil olurdu?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Çok güzel bir örnek olur aslında, ikisi arasındaki performans farkını görmüş oluruz hem,
#7 şuradaki pr da mutex ile çözümü var. Her ikisi merge edildiğinde yeni bir branch üzerinden benchmark testlerini yazarsak temiz olur diye düşünüyorum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 istersen o PR'daki commiti cherry-pick ile bu PR'a tasiyip islemleri buradan da devam ettirebiliriz tek bir .go dosyasi uzerinden. ne dusunursun?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Selamlar, ilgili pr merge edildi, buradaki süreci ilerletebilirsiniz.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
istersen o PR'daki commiti cherry-pick ile bu PR'a tasiyip islemleri buradan da devam ettirebiliriz tek bir .go dosyasi uzerinden. ne dusunursun?
102-concurrency/goroutines altında bir dizin oluşturalım o zaman, #7 deki merge ile gelen mutex lock çözümünü içerisine ekleyip benchmark testleri için tek bir dosya açarız. İlk söylediğin gibi tek bir dosyada 2 farklı metodu da eklediğimizde güzel olacaktır. Ne dersin?
En sonda dizinin görüntüsü şu şekilde olacak.
…tests added to compare solutions. Test running guide added to Readme file.
No description provided.