If you had ever done some kind of multi-threaded or concurrent programming in any languages, then there is a high chance that you would have used or at least heard about Condition Variable.
This post is an attempt to explain my understanding of the Condition Variable, which I happened to use in one of my recent projects. All the code samples are written in Go, but the concepts remains same irrespective of the programming languages.
A condition variable is basically a container of threads that are waiting for a certain condition.
That definition from wikipedia is pretty straight forward. And don’t worry if that still confusing. I hope this blog may help you understand what it is and how it can be used.
Condition Variable is one of the synchronization mechanisms.
Before using Condition Variable, lets understand what problem it tries to solve.
Lets start simple.
How to make a goroutine wait till some event(condition) occur?.
I have been using go-lang and gorm to build web apps for a while. Though gorm
provids very good documentation, I think it lacks some real-time examples. Here is
what I have learned how to use gorm for advanced queries. Most importantly to get data
from multiple tables that are not directly related.
Let me try explaining the concepts with three use cases.
Hi Everyone. Welcome to Django internal series. Goal of this entire series is to share my experience on understanding the
internals of django.
In part 1 of this series we try to understand why its important to understand
I started using django about an year ago. It’s a part of our company’s
technology stack. We love building apps with Django(of course who wouldn’t?). During early
stage of using django, I really suck at debugging as I felt django is
doing lot of magic under the hood. Few basic questions started bothering me.
I am declaring all fields in model as class variables. How come I am able to
access those as instance variables on any of those model instances?
What is happening when I access any field of a model instance. For e.g take
a look at simple_django_model.py snippet below. There we have single
field called email of type models.EmailField(). Now if try to get
user.email it should technically return models.EmailField instance right?, but django
does some magic and return the exact email address as string [email protected]
How does “class Meta” inside any model affects the model behaviour?
What does really ‘app’ mean to django?(HINT: Every directory with
__init__.py is not an app)
How django creates actual model instance from db tables?
Emojis 😃 🎉 👍 💕 have become so popular. Anyone who used Whatsapp or
Instagram knows how cool emojis are 😎. And they are everywhere now. Emoji originated in Japan. The word “emoji” means “Picture(e) letter(moji)” in Japanese.
Technically, emojis are subset of Unicode character set. In short, Unicode is the collection of every writable symbol available on the planet. That being said, unicode includes symbols from every language that exist.