Пример #1
0
        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);
            }
        }
Пример #2
0
        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();
            }
        }
Пример #3
0
 private void ClientWantsHouseholds2(object o, IRemoteXTMF client)
 {
     // Send the household data!
     client.SendCustomMessage(null, 2);
 }
Пример #4
0
 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 );
     }
 }