Writing our own Concurrent Thread safe Queue



Writing our own Concurrent Thread safe Queue

Writing our own Concurrent Thread safe Queue

Join Replit: https://join.replit.com/arpit-bhayani
Repl: https://replit.com/@arpitbbhayani/ConcurrentQueue
GitHub Repository: https://github.com/arpitbbhayani/concurrency-in-depth

System Design for Beginners: https://arpitbhayani.me/sys-design
System Design for Experienced Engineers: https://arpitbhayani.me/masterclass
Become a member for exclusive in-depth videos: https://www.youtube.com/c/ArpitBhayani/join
Redis Internals: https://arpitbhayani.me/redis

Queues are everywhere; you can find them in message brokers, event-driven systems, thread pools, and to name a few.

A naive queue implementation is not thread-safe at all, which means when multiple threads add or removed from a queue, it may lead to incorrect results and worse runtime exceptions.

In this video, we start with understanding what concurrent queues are and why we need them, then write our own Concurrent Thread-safe Queue in Golang to get a deeper understanding, and then touch upon some real-world applications.

Outline:

00:00 Introduction
01:21 What are concurrent queues?
02:45 Writing Concurrent Thread-safe Queue
06:54 Multi-threaded Enqueue and Dequeue
08:38 Making the queue thread-safe
13:47 Advantages and Limitations of Concurrent Queues
14:53 Real-world applications

# Arpit’s System Design Masterclass

I teach a course on System Design where you’ll learn how to intuitively design scalable systems. The course will help you

– become a better engineer
– ace your technical discussions
– get you acquainted with a massive spectrum of topics ranging from Storage Engines, High-throughput systems, to super-clever algorithms behind them.

I have compressed my ~10 years of work experience into this course, and aim to accelerate your engineering growth 100x. To date, the course is trusted by 1000+ engineers from 13 different countries.

Together, we will build some of the most amazing systems and dissect them to understand the intricate details. You can find the week-by-week curriculum and topics, benefits, testimonials, and other information here

https://arpitbhayani.me/masterclass.

### Other links

If you have solved an interesting problem and want to talk about it on my channel, check out
https://arpitbhayani.me/podcast

CS Engineering and Software Development books that I have read
https://arpitbhayani.me/bookshelf

Research papers that I have read
https://arpitbhayani.me/papershelf

Newsletter: https://arpit.substack.com
LinkedIn: https://linkedin.com/in/arpitbhayani
Twitter: https://twitter.com/arpit_bhayani
To follow the blogs and papers I am reading, join my telegram channel at https://t.me/asliengineering

You can find handwritten notes and text notes about this video at https://arpitbhayani.me.

Until next time, stay awesome 🙂

Yours truly,
Arpit
https://arpitbhayani.me
#AsliEngineering

Comments are closed.