private static string threadSpecificData;
Thread thread1 = new Thread(() =>
PerformThreadSpecificOperation("Thread 1", "Data from Thread 1");
Thread thread2 = new Thread(() =>
PerformThreadSpecificOperation("Thread 2", "Data from Thread 2");
Console.WriteLine("All threads completed.");
static void PerformThreadSpecificOperation(string threadName, string value)
threadSpecificData = value;
Console.WriteLine($"{threadName}: Retrieved data - {threadSpecificData}");