private void SendNewJob(IRemoteXTMF client) { System.Threading.Thread.MemoryBarrier(); int i = IndexOfNextJob(); if (i >= 0) { CurrentJobs[i].Processing = true; CurrentJobs[i].ProcessedBy = client; System.Threading.Thread.MemoryBarrier(); client.SendCustomMessage(i, RequestJobChannel); } }
private void SendNextParameter(IRemoteXTMF client) { ResultMessage msg = new ResultMessage(); lock (this) { // make sure we have the newest memory loaded up Thread.MemoryBarrier(); var populationLength = Population.Length; for (int i = 0; i < populationLength; i++) { if (Population[i].Processing == false) { Population[i].ProcessedBy = client; Population[i].Processing = true; msg.ProcessedIndex = i; client.SendCustomMessage(msg, 1); break; } } // make sure changes have gone through Thread.MemoryBarrier(); } }
private void ClientWantsHouseholds2(object o, IRemoteXTMF client) { // Send the household data! client.SendCustomMessage(null, 2); }
private void SendNewJob(IRemoteXTMF client) { System.Threading.Thread.MemoryBarrier(); int i = IndexOfNextJob(); if ( i >= 0 ) { this.CurrentJobs[i].Processing = true; this.CurrentJobs[i].ProcessedBy = client; System.Threading.Thread.MemoryBarrier(); client.SendCustomMessage( i, this.RequestJobChannel ); } }