Search Results

Search found 4382 results on 176 pages for 'priority queue'.

Page 11/176 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Reduce the I/O priority of Windows Backup (Windows Server 2008 R2)

    - by HelloSam
    I have a PostgreSQL running on Windows Server 2008 R2 x64 box. And I have scheduled a backup everyday from the RAID 1 DB disk to a dedicated standalone disk. They are SAS 15k on Dell PERC 6i. I am using the built-in Windows Server Backup for purpose. The problem is, whenever the backup process is kicked in, the database performance is hogged. I would say almost a 10x of performance reduction. From the resource monitor, the disk queue is in the double digit range when backing up, and less than 1 during the day. The disk activity is like ~30-50MB/s during backup, so I guess the hardware is acting normally, though wbengine.exe takes up most of the portions. I think reduce the IO priority of the backup process would be an answer, but I couldn't find a way to. Tuning process CPU priority does not seems to help.

    Read the article

  • Mail Stuck in Backend Exchange Queue

    - by Kyle Brandt
    I have a message that has and is stuck in a queue on my backend mail server. The queue is: Internet Mail SMTP Connector (MY_FRONT_END_SERVER_NAME)-524350ff... It is in state retry with 183 failures. It is only one message and all other mail is flowing. The message is not particularly large. My limited understanding, a guess really, is that this message should get handed off to the front end mail server and sent to the remote hosts for which it is destined, so it should even matter if the remote host is up. However, I can telnet to the smtp provider of that host. How can I find out why it is stuck in this queue, and can I force it out somehow (unfreeze doesn't help me)?

    Read the article

  • Single email Stuck in Backend Exchange Queue

    - by Kyle Brandt
    I have an outgoing message that has and is stuck in a queue on my backend mail server. The queue is: Internet Mail SMTP Connector (MY_FRONT_END_SERVER_NAME)-524350ff... It is in state retry with 183 failures. It is only one message and all other mail is flowing. The message is not particularly large. My limited understanding, a guess really, is that this message should get handed off to the front end mail server and sent to the remote hosts for which it is destined, so it should even matter if the remote host is up. However, I can telnet to the smtp provider of that host. How can I find out why it is stuck in this queue, and can I force it out somehow (unfreeze doesn't help me)?

    Read the article

  • Normal Priority Builds Will Not Build in TFS 2010

    - by 37Stars
    I have two build processes setup in TFS 2010. One build starts when any developer checks code into TFS. The second build runs every night at 12:30am. I can see the builds have a priority of Normal in the queue. However no queued build ever is run until I change the priority to high. They will sit in the queue forever until the priority is changed. It appears there is a normal priority build in the queue that is stuck. However I cannot find it. I can select , , and and not see anything but these builds queued up. I can run them all and the next day I have queued builds again. I say this because I see the Build Service is configured for port 9192, which leads me to believe there is or was another Build Service on port 9191. Any idea how to resolve this issue? Thanks

    Read the article

  • Mistake in display and insert methods (double-ended queue)

    - by MANAL
    1) My problem when i make remove from right or left program will be remove true but when i call diplay method the content wrong like this I insert 12 43 65 23 and when make remove from left program will remove 12 but when call display method show like this 12 43 65 and when make remove from right program will remove 23 but when call display method show like this 12 43 Why ?????? ); and when i try to make insert after remove write this Can not insert right because the queue is full . first remove right and then u can insert right where is the problem ?? Please Help me please 2) My code FIRST CLASS class dqueue { private int fullsize; //number of all cells private int item_num; // number of busy cells only private int front,rear; public int j; private double [] dqarr; //========================================== public dqueue(int s) //constructor { fullsize = s; front = 0; rear = -1; item_num = 0; dqarr = new double[fullsize]; } //========================================== public void insert(double data) { if (rear == fullsize-1) rear = -1; rear++; dqarr[rear] = data; item_num++; } public double removeLeft() // take item from front of queue { double temp = dqarr[front++]; // get value and incr front if(front == fullsize) front = 0; item_num --; // one less item return temp; } public double removeRight() // take item from rear of queue { double temp = dqarr[rear--]; // get value and decr rear if(rear == -1) // rear = item_num -1; item_num --; // one less item return temp; } //========================================= public void display () //display items { for (int j=0;j<item_num;j++) // for every element System.out.print(dqarr[j] +" " ); // display it System.out.println(""); } //========================================= public int size() //number of items in queue { return item_num; } //========================================== public boolean isEmpty() // true if queue is empty { return (item_num ==0); } } SECOND CLASS import java.util.Scanner; class dqueuetest { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println(" ***** Welcome here***** "); System.out.println(" ***** Mind Of Programming Group***** "); System.out.println(" _____________________________________________ "); System.out.println("enter size of your dqueue"); int size = input.nextInt(); dqueue mydq = new dqueue(size); System.out.println(""); System.out.println("enter your itemes"); //===================================== for(int i = 0;i<=size-1;i++) { System.out.printf("item %d:",i+1); double item = input.nextDouble(); mydq.insert(item); System.out.println(""); } //===================================== int queue =size ; int c = 0 ; while (c != 6) { System.out.println(""); System.out.println("************************************************"); System.out.println(" MAIN MENUE"); System.out.println("1- INSERT RIGHT "); System.out.println("2- REMOVE LEFT"); System.out.println("3- REMOVE RIGHT"); System.out.println("4- DISPLAY"); System.out.println("5- SIZE"); System.out.println("6- EXIT"); System.out.println("************************************************"); System.out.println("choose your operation by number(1-6)"); c = input.nextInt(); switch (c) { case 1: if (queue == size) System.out.print("Can not insert right because the queue is full . first remove right and then u can insert right "); else { System.out.print("enter your item: "); double item = input.nextDouble(); mydq.insert(item);} break; case 2: System.out.println("REMOVE FROM REAR :"); if( !mydq.isEmpty() ) { double item = mydq.removeLeft(); System.out.print(item + "\t"); } // end while System.out.println(""); mydq.display(); break; case 3: System.out.println("REMOVE FROM FRONT :"); if( !mydq.isEmpty() ) { double item = mydq.removeRight(); System.out.print(item + "\t"); } // end while System.out.println(""); mydq.display(); break; case 4: System.out.println("The items in Queue are :"); mydq.display(); break; case 5: System.out.println("The Size of the Queue is :"+mydq.size()); break; case 6: System.out.println("Good Bye"); break; default: System.out.println("wrong chiose enter again"); } //end switch } //end while } // end main }//end class

    Read the article

  • Mistake in dispaly and insert method (double - ended queue)

    - by MANAL
    1) My problem when i make remove from right or left program will be remove true but when i call diplay method the content wrong like this I insert 12 43 65 23 and when make remove from left program will remove 12 but when call display method show like this 12 43 65 and when make remove from right program will remove 23 but when call display method show like this 12 43 Why ?????? ); and when i try to make insert after remove write this Can not insert right because the queue is full . first remove right and then u can insert right where is the problem ?? Please Help me please 2) My code FIRST CLASS class dqueue { private int fullsize; //number of all cells private int item_num; // number of busy cells only private int front,rear; public int j; private double [] dqarr; //========================================== public dqueue(int s) //constructor { fullsize = s; front = 0; rear = -1; item_num = 0; dqarr = new double[fullsize]; } //========================================== public void insert(double data) { if (rear == fullsize-1) rear = -1; rear++; dqarr[rear] = data; item_num++; } public double removeLeft() // take item from front of queue { double temp = dqarr[front++]; // get value and incr front if(front == fullsize) front = 0; item_num --; // one less item return temp; } public double removeRight() // take item from rear of queue { double temp = dqarr[rear--]; // get value and decr rear if(rear == -1) // rear = item_num -1; item_num --; // one less item return temp; } //========================================= public void display () //display items { for (int j=0;j //========================================= public int size() //number of items in queue { return item_num; } //========================================== public boolean isEmpty() // true if queue is empty { return (item_num ==0); } } SECOND CLASS import java.util.Scanner; class dqueuetest { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println(" Welcome here** "); System.out.println(" * Mind Of Programming Group*** "); System.out.println(" _________________________ "); System.out.println("enter size of your dqueue"); int size = input.nextInt(); dqueue mydq = new dqueue(size); System.out.println(""); System.out.println("enter your itemes"); //===================================== for(int i = 0;i<=size-1;i++) { System.out.printf("item %d:",i+1); double item = input.nextDouble(); mydq.insert(item); System.out.println(""); } //===================================== int queue =size ; int c = 0 ; while (c != 6) { System.out.println(""); System.out.println("**************************"); System.out.println(" MAIN MENUE"); System.out.println("1- INSERT RIGHT "); System.out.println("2- REMOVE LEFT"); System.out.println("3- REMOVE RIGHT"); System.out.println("4- DISPLAY"); System.out.println("5- SIZE"); System.out.println("6- EXIT"); System.out.println("**************************"); System.out.println("choose your operation by number(1-6)"); c = input.nextInt(); switch (c) { case 1: if (queue == size) System.out.print("Can not insert right because the queue is full . first remove right and then u can insert right "); else { System.out.print("enter your item: "); double item = input.nextDouble(); mydq.insert(item);} break; case 2: System.out.println("REMOVE FROM REAR :"); if( !mydq.isEmpty() ) { double item = mydq.removeLeft(); System.out.print(item + "\t"); } // end while System.out.println(""); mydq.display(); break; case 3: System.out.println("REMOVE FROM FRONT :"); if( !mydq.isEmpty() ) { double item = mydq.removeRight(); System.out.print(item + "\t"); } // end while System.out.println(""); mydq.display(); break; case 4: System.out.println("The items in Queue are :"); mydq.display(); break; case 5: System.out.println("The Size of the Queue is :"+mydq.size()); break; case 6: System.out.println("Good Bye"); break; default: System.out.println("wrong chiose enter again"); } //end switch } //end while } // end main }//end class

    Read the article

  • How to specify a remote private queue in NServiceBus?

    - by Benny
    I tried to modify the sample PubSub from NServiceBus, which says in order to configure remote endpoints use the format: "queue@machine" and I didn't see the message arrive on the publishing machine, the following is the config of subscriber <UnicastBusConfig> <MessageEndpointMappings> <add Messages="MyMessages" Endpoint="MyPublisherInputQueue@Dell755" /> </MessageEndpointMappings> </UnicastBusConfig>

    Read the article

  • Should I move this task to a message queue?

    - by Fedyashev Nikita
    I'm a big fan of using message queue systems(like Apache ActiveMQ) for the tasks which are rather slow and do not require instant feedback in User Interface. The question is: Should I use it for other tasks(which are pretty fast) and do not require instant feedback in User Interface? Or does it in involve another level of complexity without not so much benefits?

    Read the article

  • Sorted queue with dropping out elements

    - by ffriend
    I have a list of jobs and queue of workers waiting for these jobs. All the jobs are the same, but workers are different and sorted by their ability to perform the job. That is, first person can do this job best of all, second does it just a little bit worse and so on. Job is always assigned to the person with the highest skills from those who are free at that moment. When person is assigned a job, he drops out of the queue for some time. But when he is done, he gets back to his position. So, for example, at some moment in time worker queue looks like: [x, x, .83, x, .7, .63, .55, .54, .48, ...] where x's stand for missing workers and numbers show skill level of left workers. When there's a new job, it is assigned to 3rd worker as the one with highest skill of available workers. So next moment queue looks like: [x, x, x, x, .7, .63, .55, .54, .48, ...] Let's say, that at this moment worker #2 finishes his job and gets back to the list: [x, .91, x, x, .7, .63, .55, .54, .48, ...] I hope the process is completely clear now. My question is what algorithm and data structure to use to implement quick search and deletion of worker and insertion back to his position. For the moment the best approach I can see is to use Fibonacci heap that have amortized O(log n) for deleting minimal element (assigning job and deleting worker from queue) and O(1) for inserting him back, which is pretty good. But is there even better algorithm / data structure that possibly take into account the fact that elements are already sorted and only drop of the queue from time to time?

    Read the article

  • Multilevel Queue Scheduling (MQS) with Round Robin

    - by stackuser
    I'm trying to use MQS to create a Gantt chart of 5 processes (P1-P5) as well as their waiting, response, and turnaround times (and averages of those metrics) within a CPU task schedule. Here's the basic table of arrival times and bursts: Here's my actual work version after ticking off the finished processes. The time quantum for each time slice is (2 queues) TQ1=4 and TQ2=3. Note that I'm doing MQS and NOT MLFQ: It just doesn't feel like I'm doing MQS right here, I know this gets a little complex but maybe someone can point out where I'm going totally wrong.

    Read the article

  • Push-Based Events in a Services Oriented Architecture

    - by Colin Morelli
    I have come to a point, in building a services oriented architecture (on top of Thrift), that I need to expose events and allow listeners. My initial thought was, "create an EventService" to handle publishing and subscribing to events. That EventService can use whatever implementation it desires to actually distribute the events. My client automatically round-robins service requests to available service hosts which are determined using Zookeeper-based service discovery. So, I'd probably use JMS inside of EventService mainly for the purpose of persisting messages (in the event that a service host for EventService goes down before it can distribute the message to all of the available listeners). When I started considering this, I began looking into the differences between Queues and Topics. Topics unfortunately won't work for me, because (at least for now), all listeners must receive the message (even if they were down at the time the event was pushed, or hadn't made a subscription yet because they haven't completed startup (during deployment, for example) - messages should be queued until the service is available). However, I don't want EventService to be responsible for handling all of the events. I don't think it should have the code to react to events inside of it. Each of the services should do what it needs with a given event. This would indicate that each service would need a JMS connection, which questions the value of having EventService at all (as the services could individually publish and subscribe to JMS directly). However, it also couples all of the services to JMS (when I'd rather that there be a single service that's responsible for determining how to distribute events). What I had thought was to publish an event to EventService, which pulls a configuration of listeners from some configuration source (database, flat file, irrelevant for now). It replicates the message and pushes each one back into a queue with information specific to that listener (so, if there are 3 listeners, 1 event would become 3 events in JMS). Then, another thread in EventService (which is replicated, running on multiple hots) would be pulling from the queue, attempting to make the service call to the "listener", and returning the message to the queue (if the service is down), or discarding the message (if the listener completed successfully). tl;dr If I have an EventService that is responsible for receiving events and delegating service calls to "event listeners," (which are really just endpoints on other services), how should it know how to craft the service call? Should I create a generic "Event" object that is shared among all services? Then, the EventService can just construct this object and pass it to the service call. Or is there a better answer to this problem entirely?

    Read the article

  • Algorithms for pairing a rating system to an assignment queue

    - by blunders
    Attempting to research how to allow a group of people to effectively rank a set of objects (each group member will have contributed one object to the group), and then assign each member an object that's not their own based on: Their ratings of the objects, Their objects rating, and The object remaining to be assigned. Idea is to attempt to assign objects to people based on the groups rating of their contribution to the group relative to other member's contribution, the the personal preferences expressed via the ratings. Any suggestions for: Further research, Refining the statement of the problem/solution, or A solution.

    Read the article

  • Using tumblr auto-queue

    - by AK
    Can't get this thing to work. Has anyone else had any success with Tumblr's auto-publish queue feature? I have a bunch of items in my queue It's set to auto-publish once a day It's set to only publish between 1am and 3am The next morning nothing will be published. The interface isn't perfectly clear - is it attempting to auto-post at a time that's not between 1 - 3 and then giving up?

    Read the article

  • Getting the error "SMTP server cannot create a file in the queue directory C:\Inetpub\mailroot\Queue\"

    - by Glenn Slaven
    We're using the default SMTP server for our websites to send mail with, but in the last day sending messages started getting this error: Insufficient system storage. The server response was: 4.3.1 Out of memory Further digging found this message in the System event log: SMTP server cannot create a file in the queue directory C:\Inetpub\mailroot\Queue\ I've since given the Everyone account full control of the mailroot folder but it's still happening. There's enough space on the server and to the best of my knowledge nothing on the server has been changed

    Read the article

  • Consolidated queue for video on demand?

    - by Herb Caudill
    It's great having lots of video on demand options, but actually choosing something to watch is turning into a mess - I have to jump from one website or application to another. I'd like to have a single queue where I can add and prioritize movies and TV I want to watch from any source: iTunes purchases, iTunes rentals, Netflix on demand, Amazon video on demand, Hulu, etc. I'd like the consolidated queue to be accessible from Front Row on my Mac Mini. Does such a thing exist?

    Read the article

  • Purpose of front() and back() in assigning values in a Queue? (C++)

    - by kevin
    I have declared: queue<int, list<int> > Q After a series of calls: Q.push(37); Q.pop(); Q.push(19); Q.push(3); Q.push(13); Q.front(); Q.push(22); Q.push(8); Q.back(); I get: 19-3-13-22-8-NULL What I don't get is what the calls to Q.front() and Q.back() do. From what I understand, they return a reference to the first or last elements respectively, but I dont see how my list would be any different had those calls not been made. Do they have any effect? Sorry if this seems trivial, but I'm trying to figure out of those calls have a purpose, or of my professor is just trying to screw with me.

    Read the article

  • &ldquo;Why do transactional messages all have the same priority?&rdquo;

    - by John Breakwell
    I answered this question on the MSMQ forum on MSDN and thought it worth sharing here. The poster wanted to know why all transactional messages have a fixed priority of zero (instead of 0 through 7). They wanted the guaranteed delivery of messages to a queue but wanted to assign different levels of priority. Some aspects of MSMQ were defined way back in the last century and this is one of them. If I remember right, the reason was to avoid the following scenario: You have a single transaction of 3 messages (a, b and c) with priorities 5, 3 and 4 respectively. The messages are sent in order a,b,c The messages arrive in the queue and are arranged in order a,c,b to reflect priority order This breaks the guaranteed order part of the transaction.  I know that very few people send more than one message in a transaction but that is a scenario that MSMQ has to be able to handle; for the majority, including yourself, this scenario is irrelevant which is why you are surprised by the absence of transactional priorities. The options, therefore, available to the Microsoft developers were to: Implement code that allowed you to send messages with variable priority as long as any messages within the same transaction were the same priority, or Define a set priority for all transactional messages As you can understand, option 1 would be a complicated arrangement with all the necessary enforcement, error handling, user education and documentation, etc. Sure, it would have been possible to implement option 1 but I expect the product group decided to invest the development time in some other aspect of MSMQ. Now, with five versions out there, it would be confusing to change how the product operates, in addition to potentially breaking exisiting systems that have been working fine for years. So, balancing cost and risk against customer demand, I would not expect this feature to ever change.

    Read the article

  • Syncronization Exception

    - by Kurru
    Hi I have two threads, one thread processes a queue and the other thread adds stuff into the queue. I want to put the queue processing thread to sleep when its finished processing the queue I want to have the 2nd thread tell it to wake up when it has added an item to the queue However these functions call System.Threading.SynchronizationLockException: Object synchronization method was called from an unsynchronized block of code on the Monitor.PulseAll(waiting); call, because I havent syncronized the function with the waiting object. [which I dont want to do, i want to be able to process while adding items to the queue]. How can I achieve this? Queue<object> items = new Queue<object>(); object waiting = new object(); 1st Thread public void ProcessQueue() { while (true) { if (items.Count == 0) Monitor.Wait(waiting); object real = null; lock(items) { object item = items.Dequeue(); real = item; } if(real == null) continue; .. bla bla bla } } 2nd Thread involves public void AddItem(object o) { ... bla bla bla lock(items) { items.Enqueue(o); } Monitor.PulseAll(waiting); }

    Read the article

  • Linux/Unix MTA with the smartest queue?

    - by threecheeseopera
    I am looking for an MTA that will allow me (a script, really) to proactively manage it's send queue in response to status codes returned by the remote servers I am delivering to. Basically, for each mail sent I would like to be able to react to the SMTP reply code returned by the remote server, ex. '250 OK', or to any error conditions like connection timeouts. Additionally, I would like to be able to manage the send queue moving forward based on this information, e.g. 'example.com has timed out the last 5 connection attempts, so no longer queue mail for recipients @example.com'. I am currently using postfix and perl to parse it's logs for this information, but I am playing a game of catchup that is prone to errors (out-of-order log entries etc.) and it's starting to get messy (some real ugly regexes ;). I really don't want to reinvent the wheel and use some language's smtp library; i would prefer to use a proven/fast/reliable MTA. I am however open to suggestions if what I need just isn't possible. Thanks for your help!

    Read the article

  • Better viewing of postfix mail queue files than postcat?

    - by Geekman
    So I got a call early this morning about a client needing to see what email they have waiting to be delivered sitting in our secondary mail server. Their link for the main server had (still is) been down for two days and they needed to see their email. So I wrote up a quick perl script to use mailq in combination with postcat to dump each email for their address into separate files, tar'd it up and sent it off. Horrible code, I know, but it was urgent. My solution works OK in that it at least gives a raw view, but I thought tonight it would be nice if I had a solution where I could provide their email attachments and maybe remove some "garbage" header text as well. Most of the important emails seem to have a PDF or similar attached. I've been looking around but the only method of viewing queue files I can see is the postcat command, and I really don't want to write my own parser - so I was wondering if any of you have already done so, or know of a better command to use? Here's the code for my current solution: #!/usr/bin/perl $qCmd="mailq | grep -B 2 \"someemailaddress@isp\" | cut -d \" \" -f 1"; @data = split(/\n/, `$qCmd`); $i = 0; foreach $line (@data) { $i++; $remainder = $i % 2; if ($remainder == 0) { next; } if ($line =~ /\(/ || $line =~ /\n/ || $line eq "") { next; } print "Processing: " . $line . "\n"; `postcat -q $line > $line.email.txt`; $subject=`cat $line.email.txt | grep "Subject:"`; #print "SUB" . $subject; #`cat $line.email.txt > \"$subject.$line.email.txt\"`; } Any advice appreciated.

    Read the article

  • Is there a better tool than postcat for viewing postfix mail queue files?

    - by Geekman
    So I got a call early this morning about a client needing to see what email they have waiting to be delivered sitting in our secondary mail server. Their link for the main server had (still is) been down for two days and they needed to see their email. So I wrote up a quick Perl script to use mailq in combination with postcat to dump each email for their address into separate files, tar'd it up and sent it off. Horrible code, I know, but it was urgent. My solution works OK in that it at least gives a raw view, but I thought tonight it would be nice if I had a solution where I could provide their email attachments and maybe remove some "garbage" header text as well. Most of the important emails seem to have a PDF or similar attached. I've been looking around but the only method of viewing queue files I can see is the postcat command, and I really don't want to write my own parser - so I was wondering if any of you have already done so, or know of a better command to use? Here's the code for my current solution: #!/usr/bin/perl $qCmd="mailq | grep -B 2 \"someemailaddress@isp\" | cut -d \" \" -f 1"; @data = split(/\n/, `$qCmd`); $i = 0; foreach $line (@data) { $i++; $remainder = $i % 2; if ($remainder == 0) { next; } if ($line =~ /\(/ || $line =~ /\n/ || $line eq "") { next; } print "Processing: " . $line . "\n"; `postcat -q $line > $line.email.txt`; $subject=`cat $line.email.txt | grep "Subject:"`; #print "SUB" . $subject; #`cat $line.email.txt > \"$subject.$line.email.txt\"`; } Any advice appreciated.

    Read the article

  • How to queue and call actual methods (rather than immediately eval) in java?

    - by alleywayjack
    There are a list of tasks that are time sensitive (but "time" in this case is arbitrary to what another program tells me - it's more like "ticks" rather than time). However, I do NOT want said methods to evaluate immediately. I want one to execute after the other finished. I'm using a linked list for my queue, but I'm not really sure how/if I can access the actual methods in a class without evaluating them immediate. The code would look something like... LinkedList<Method> l = new LinkedList<Method>(); l.add( this.move(4) ); l.add( this.read() ); l.removeFirst().call(); //wait 80 ticks l.removeFirst().call(); move(4) would execute immediately, then 80 ticks later, I would remove it from the list and call this.read() which would then be executed. I'm assuming this has to do with the reflection classes, and I've poked around a bit, but I can't seem to get anything to work, or do what I want. If only I could use pointers...

    Read the article

  • Trying to write priority queue in Java but getting "Exception in thread "main" java.lang.ClassCastEx

    - by Dan
    For my data structure class, I am trying to write a program that simulates a car wash and I want to give fancy cars a higher priority than regular ones using a priority queue. The problem I am having has something to do with Java not being able to type cast "Object" as an "ArrayQueue" (a simple FIFO implementation). What am I doing wrong and how can I fix it? public class PriorityQueue<E> { private ArrayQueue<E>[] queues; private int highest=0; private int manyItems=0; public PriorityQueue(int h) { highest=h; queues = (ArrayQueue[]) new Object[highest+1]; <----problem is here } public void add(E item, int priority) { queues[priority].add(item); manyItems++; } public boolean isEmpty( ) { return (manyItems == 0); } public E remove() { E answer=null; int counter=0; do { if(!queues[highest-counter].isEmpty()) { answer = queues[highest-counter].remove(); counter=highest+1; } else counter++; }while(highest-counter>=0); return answer; } }

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >