Changeset 805 for trunk/sources/HeuristicLab.Hive.Server.Core
- Timestamp:
- 11/23/08 18:05:59 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
r797 r805 13 13 public class ClientCommunicator: IClientCommunicator { 14 14 List<ClientInfo> clients; 15 Li st<long> jobs;15 LinkedList<long> jobs; 16 16 int nrOfJobs = 10; 17 17 18 18 public ClientCommunicator() { 19 jobs = new Li st<long>();20 for ( inti = 1; i < nrOfJobs; i++) {21 jobs.Add (i);19 jobs = new LinkedList<long>(); 20 for (long i = 1; i < nrOfJobs; i++) { 21 jobs.AddFirst(i); 22 22 } 23 23 } … … 54 54 public ResponseJob PullJob(Guid clientId) { 55 55 ResponseJob response = new ResponseJob(); 56 57 response.JobId = jobs.ElementAt(jobs.Count); 56 lock (this) { 57 response.JobId = jobs.Last.Value; 58 jobs.RemoveLast(); 59 } 60 58 61 response.Success = true; 59 response.StatusMessage = "Job with id " + jobs.Count + " sent"; 60 jobs.Remove(jobs.Count); 61 62 response.StatusMessage = "Job with id " + jobs.Count + " sent"; 62 63 return response; 63 64 } … … 70 71 return response; 71 72 } 72 73 73 74 public Response Logout(Guid clientId) { 74 75 bool clientRemoved = false;
Note: See TracChangeset
for help on using the changeset viewer.