InterLocked synchronisation with Multithreading
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; namespace InterlockedClassDemo { public partial class Form1 : Form { int Number = 0; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Number =0; //whenever a button is clicked the Number is reassigned to 0 int totalThread = 10000; ...
Comments
Post a Comment