I want to allow different threads to make changes to different elements of Value by acquiring locks only for those elements and not the whole object.
For example: Consider the dictionary -
D = {1:[time, speed, distance],2:[time1,speed1, distance1], 3:[time2, speed2, distance2]}
Thread T1 to modify D[1][0]
, thread T2 to modify D[1][1]
, thread T3 to modify D[2][2]
, etc., Hence T1 should lock D[1][0]
, T2 should lock D[1][1]
. T3 should lock D[2][2]
and modify them concurrently.