public static void Main() { int noOfClients = 1000; int noOfClerks = 3; PostOffice po = new PostOffice(noOfClerks); for (int i = 0; i < noOfClients; i++) { Client c = new Client(po); Thread th = new Thread(new ThreadStart(c.goToPost)); th.Start(); } Console.WriteLine("Otwieramy wszystkie okienka"); po.semaphore.Release(noOfClerks); }
public Clerk(PostOffice postOffice) { this.postOffice = postOffice; ID = last_id++; }
public Client(PostOffice po) { this.postOffice = po; ID = last_id++; }