I am using concurrent queue and dequeue the data from queue via multiple threads by creation Action delegate
Action action = () =>
{
SubscriptionResponseModel subsModel;
while (concurrentQueue.TryTake(out subsModel))
{
MakeTransactionAndAddIntoQueue(subsModel);
}
};
And invoke this action delegate parallel multiple threads
Parallel.Invoke(action, action, action, action, action, action, action, action, action, action, action, action, action, action, action);
I want to know one thing when I am using SubscriptionResponseModel subsModel;
in multiple actions is it thread safe?.