Похожие чаты

When you program concurrently the variables are exposed being shared

and that is where the channel comes in to ensure communication in a safe way in a competitive scenario.
In Go it is possible to use the synchronization primitives and this is very interesting because he did not eliminate this possibility, the language allows its use, in the past we did not have Maps to work in a competing environment, for this to be possible we had to implement and see just how could we do this? Using Mutex ... This is an implementation that I did in the past https://gist.github.com/jeffotoni/13160dcac45068f31d56193cd0cbbe49 and just below in the answer another solution using sync.Map.
The examples in the post depict to take care and reflect more on primitives using Mutex and Channel, and that in some scenarios it is interesting to use primitives instead of channel, super valid from his point of view, he needed to lower the level even more in his projects .
It will arrive at a moment that will come up against GC do Go in the memory heaps and then the conversation starts to get even more interesting.
Remembering that Go is a new lang, which is maturing and advancing very fast, it has several points that need to improve as in any other lang.
Now, like Go community, I'm sure there are few like ours... 🥳🥳🥳🥳
but
But we know that the use of sync.Mutex when we have thousands of goroutines the performance is affected, making a very simple benchmarking to understand but read this post
https://stackoverflow.com/questions/57562606/why-does-sync-mutex-largely-drop-performance-when-goroutine-contention-is-more-t

1 ответов

17 просмотров

thanks I get the difference between channels and concurrency primitives, I just don't really understand the example in the premise of the article

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта