क्या मैं यह सोचने में सही हूं कि यह एक समवर्ती शब्दकोश का सही उपयोग है
private ConcurrentDictionary<int,long> myDic = new ConcurrentDictionary<int,long>();
//Main thread at program startup
for(int i = 0; i < 4; i++)
{
myDic.Add(i, 0);
}
//Seperate threads use this to update a value
myDic[InputID] = newLongValue;
मेरे पास कोई ताले आदि नहीं हैं और मैं केवल शब्दकोश में मूल्य को अपडेट कर रहा हूं, भले ही कई धागे एक ही करने की कोशिश कर रहे हों।
newLongValueके पिछले मूल्य पर निर्भर करता हैmyDic[InputID]?