Golang Data Structures For Beginners - Generic SafeMap

preview_player
Показать описание
In this Golang tutorial, I will teach you how to make a generic concurrent safe map data structure. The standard map in Golang is not safe for concurrent use. We will use Golang generics to implement our own concurrent safe hash map. If you are willing to learn more about the go programming language consider subscribing to my channel!

📢 I am also building a Discord community! Feel free to join if you are willing to learn about distributed systems, blockchain, web3, Defi, and quantitative trading. Or just hang out and chat.

► Support me on PATREON and get access to exclusive lessons, tutorials, and LIVE streams

► Join my Discord community for free education

► Follow me on GitHub

► Follow me on Twitter

#golang
Рекомендации по теме
Комментарии
Автор

👉 Join the Discord community for blockchain, web3, Defi, and quant trading education:

Thanks for watching <3

anthonygg_
Автор

Very useful video, thank you
Incidentally
Defer is very important in some cases. for example:


conn.fetch ()
conn.close ()


VS


defer conn.close ()
conn.fetch ()


When the fetch() fails, a resource leak occurs. But with defer r, we are sure that the conn was closed and the memory was released

baxiry.
Автор

Anthony is a GoLang Wizard 🧙🏼‍♂️
Great lesson as always 💯

interstellar
Автор

bro, you did this like it was nothing!! great insight!!

joebuydem
Автор

Hi Anthony. Thank you for your outstanding work. Also great to see your subs are increasing at a rapid pace.

ukxgerard
Автор

Hello, thank you for this video. Can i ask one thing ? What if i want to have structure with more fields and i need lock just some of these fields at the same time and second part of the struct will be locked in different useCase. What is clean way to have two mutexes in one struct? I tried it and it looks like mess to me plus i am not sure which mutex it applied for which field... Thanks, Karel.

KarelKopriva
Автор

8:30 I am pretty sure since 1.14 'defer' has been fixed and doesn't incur any overhead.

fieldtrip
Автор

next step would be implementing lockless map :)

lotierm
visit shbcf.ru