In this video, I have demonstrated another example of thread synchronization.
Task assigned to thread is to do sum of 1 to n. Each thread has its own n.
To do sum, SumResource class is available whose object is shared among all threads.
Each thread calls doSum() method on same instance of SumResource class.