Changeset 13946
- Timestamp:
- 06/29/16 00:50:42 (8 years ago)
- Location:
- branches/thasling/DistributedGA/DistributedGA.Core/Implementation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs
r13945 r13946 21 21 //provides current population for the higher layer IMigrationOperator 22 22 //two queues are used to gather and and provide population more efficiently 23 private object activeQueueLocker = new object(); 24 private SizedConcurrentQueue<byte[]> writeQueueOriginal; 25 private SizedConcurrentQueue<byte[]> writeQueueAlternative; 26 27 //queue for recieved items 23 private static object activeQueueLocker = new Object(); 24 private SizedConcurrentQueue<byte[]> writeQueue; 28 25 private SizedConcurrentQueue<byte[]> readQueue; 29 26 30 27 //uses IMessageService for recieving population from one peer at once 31 28 private IMessageService host = null; 32 33 29 34 30 … … 41 37 }; // TODO: get own peerinfo 42 38 43 writeQueueOriginal = new SizedConcurrentQueue<byte[]>(); 44 writeQueueAlternative = new SizedConcurrentQueue<byte[]>(); 39 writeQueue = new SizedConcurrentQueue<byte[]>(); 45 40 readQueue = new SizedConcurrentQueue<byte[]>(); 46 writeQueueOriginal.Limit = 1000; 47 writeQueueAlternative.Limit = 1000; 48 readQueue.Limit = writeQueueOriginal.Limit; 41 writeQueue.Limit = 1000; 42 readQueue.Limit = writeQueue.Limit; 49 43 50 44 host = new WcfMessageService(); … … 99 93 //changing the current queue for storing items to send 100 94 //then read from the now unselect queue 101 var tmp = writeQueueAlternative;102 writeQueueAlternative = writeQueueOriginal;103 writeQueue Original= tmp;95 var tmp = readQueue; 96 readQueue = writeQueue; 97 writeQueue = tmp; 104 98 } 105 99 106 100 //creating resultset 107 while (! writeQueueAlternative.IsEmpty) {108 if ( writeQueueAlternative.TryDequeue(out item)) {101 while (!readQueue.IsEmpty) { 102 if (readQueue.TryDequeue(out item)) { 109 103 res.Add(item); 110 104 } … … 144 138 lock (activeQueueLocker) { 145 139 foreach (byte[] item in e.data) { 146 writeQueue Original.Enqueue(item);140 writeQueue.Enqueue(item); 147 141 } 148 142 } -
branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageSender.cs
r13943 r13946 18 18 private Timer timer; //sends cached messages to network in background 19 19 20 private Object timerLock = new Object();20 private static Object timerLock = new Object(); 21 21 22 22 public void Init(PeerInfo source) { -
branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfPeerListManager.cs
r13943 r13946 16 16 private Timer timer = null; //sends heartbeat to contact-server 17 17 18 private Object timerLock = new Object();18 private static Object timerLock = new Object(); 19 19 20 20 private ChannelFactory<IContactService> myChannelFactory;
Note: See TracChangeset
for help on using the changeset viewer.