Reference :
Reference :

Previously, you saw how a multithreaded system brings complexities with it and how can we solve it using synchronization. Now let’s see how threads can talk to each other.

I would suggest those who haven’t read that Part 1 yet, please go through it to understand the next story without any suspense.

However, these are the key concepts that we learned last time.

  1. Shared Variable: a variable that is shared by multiple threads.
  2. Critical Section: a section of the code involving a shared variable that is accessed by multiple threads
  3. Race Condition: a situation where we don’t know the final…

This is my story about learning concurrency. I have divided it into parts and this one is more focused on the problems concurrency and multithreaded system brings with them.

I kept hearing these terms parallelism and concurrency. Read their definitions, didn’t make any sense to me. It was like concurrency is a problem and parallelism is a solution to it or vice versa couldn’t recall it every time.

I searched a lot again and then I finally got to this fine article written by Jakob Jenkovs.

It cleared many things, then I saw an image on the internet which gave…

I wanted to see how garbage collections work. but all i can find was theory and theory. Thus thought to try it out with a very basic program to see it practically.

Some basic information that one should know.

1 Eden Space : All the new objects that are created goes to this part of heap

2 Survivor Spaces (S0/S1) : After minor GC reachable object from the Eden space and from one part (S0/S1) of the survivor space is transferred to another part of survivor space (S0/S1). And with this the age of each surviving object is incremented.


Tarun Kundhiya

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store