Search Results

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

Page 19/176 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Java performance problem with LinkedBlockingQueue

    - by lofthouses
    Hello, this is my first post on stackoverflow...i hope someone can help me i have a big performance regression with Java 6 LinkedBlockingQueue. In the first thread i generate some objects which i push in to the queue In the second thread i pull these objects out. The performance regression occurs when the take() method of the LinkedBlockingQueue is called frequently. I monitored the whole program and the take() method claimed the most time overall. And the throughput goes from ~58Mb/s to 0.9Mb/s... the queue pop and take methods ar called with a static method from this class public class C_myMessageQueue { private static final LinkedBlockingQueue<C_myMessageObject> x_queue = new LinkedBlockingQueue<C_myMessageObject>( 50000 ); /** * @param message * @throws InterruptedException * @throws NullPointerException */ public static void addMyMessage( C_myMessageObject message ) throws InterruptedException, NullPointerException { x_queue.put( message ); } /** * @return Die erste message der MesseageQueue * @throws InterruptedException */ public static C_myMessageObject getMyMessage() throws InterruptedException { return x_queue.take(); } } how can i tune the take() method to accomplish at least 25Mb/s, or is there a other class i can use which will block when the "queue" is full or empty. kind regards Bart P.S.: sorry for my bad english, i'm from germany ;)

    Read the article

  • Using jQuery delay() with separate elements

    - by boomturn
    I want to fake a simple animation on page load by sequentially revealing several pngs, each appearing instantly but with unique, precisely timed delay before the next one. Using the latest version of jQuery (1.4.2 at writing), which provides a delay method. My first (braindead) impulse was: $('#image1').show('fast').delay(800); $('#image2').show('fast').delay(1200); $('#image3').show('fast'); Of course all come up simultaneously. jQuery doc examples refer to a single item being chained, not handling multiple items. OK... try again using nested callbacks from show(): $('#image1').show('fast', function() { $('#image2').show('fast', function() { $('#image3').show('fast', function() { }); }); }); Looks ugly (imagine doing 10, also wonder what processor hit would be) but hey, it works sequentially! Without delay though. So... chain delay() after show() using a callback function from it (not even sure if it supports one): $('#image1').show('fast').delay(800, function() { $('#image2').show('fast').delay(1200, function() { $('#image3').show('fast'); }); }); Hm. Opposite result of what I thought might happen: the callback works, but still no delay. So... should I be using some combination of queue and delay instead of nested callbacks? jQuery doc examples for queue again only use one element for example. Guessing this would involve using a custom queue, but am uncertain how to implement this. Or maybe I'm missing a simple way? (For a simple problem!)

    Read the article

  • Tree-like queues

    - by Rehno Lindeque
    I'm implementing a interpreter-like project for which I need a strange little scheduling queue. Since I'd like to try and avoid wheel-reinvention I was hoping someone could give me references to a similar structure or existing work. I know I can simply instantiate multiple queues as I go along, I'm just looking for some perspective by other people who might have better ideas than me ;) I envision that it might work something like this: The structure is a tree with a single root. You get a kind of "insert_iterator" to the root and then push elements onto it (e.g. a and b in the example below). However, at any point you can also split the iterator into multiple iterators, effectively creating branches. The branches cannot merge into a single queue again, but you can start popping elements from the front of the queue (again, using a kind of "visitor_iterator") until empty branches can be discarded (at your discretion). x -> y -> z a -> b -> { g -> h -> i -> j } f -> b Any ideas? Seems like a relatively simple structure to implement myself using a pool of circular buffers but I'm following the "think first, code later" strategy :) Thanks

    Read the article

  • What happens to my PriorityQueue if my Comparator throws an exception while it's busy bubbling up or

    - by nieldw
    Hi, I'm trying order pairs of integers ascendantly where a pair is considered less than another pair if both its entries are strictly less than those of the other pair, and larger than the other pair if both its entries are strictly larger than those of the other pair. All other cases are considered incomparable. They way I want to solve this is by defining a Comparator that implements the above, but will throw an exception for incomparable cases, and provide that to a PriorityQueue. Of course, while inserting a pair the priority queue does several comparisons while bubbling the new entry up to its correct position in the heap, and many of these will be comparable. But it may happen during the bubbling process that a pair is encountered with which this new pair is incomparable, and an exception will be thrown. If this happens, what will be the state of the PriorityQueue? Will the pair I was trying to insert sit in the heap at the last position it was in before the exception was thrown? If I use the PriorityQueue's remove(Object o) method, will the PriorityQueue be restored to a consistent state? Thanks

    Read the article

  • Message Driven Bean with Java Message Queue down

    - by Rafa de Castro
    I have the following problem deploying my application. It uses JMS and a remote openMQ for communication between servers. The problem is that the connection is not fully reliable so it can be up or down. For reconnecting I set the jms reconnect glassfish property so it reconnects if at some moment the connection gets lost. The problem arises when i try to deploy the application and there is no connection. It looks like it keeps retrying the connection but the application does not finish deployment until connection is available. Is it possible to configure it in any way that the deployment continues even if there is no connection and keeps retrying until there is connection available? Thanks a lot.

    Read the article

  • jquery delay() doesn't delay attr() in the queue

    - by luca
    hi, what is wrong in this code? I'm trying to get this effect: fadeOut(500) and attr('class','myClass') delayed by 600 millisecs.. then delay(600) again, and fadeIn(500). The delays happen correctly but the attr() is not being delayed, it fires when #myDiv is still fading! :'( $('#myDiv').fadeOut(500).delay(600).attr('class','myClass').delay(600).fadeIn(500); many thanks in advance for any suggestions! Luca

    Read the article

  • jquery issue, disable on mouseenter queue

    - by jason
    When you mouseenter .li_group class it does a slide down effect on 1 single <li> tag, everything goes smoothly, but during the delay if you take your mouse off and on .li_group it "queues" the effect and slides the li down, delay, slides it down again etc etc... I have tried every way i can think of, even stop(); but it still does it... the reason i use mouseenter instead of hover, is because it works better for ul / li list $(".li_group").live('mouseenter',function(){ var id = "#ec1"; $(id).slideDown(); }).live('mouseleave',function(){ if (jQuery.support.cssFloat==true || getInternetExplorerVersion() > 7) { //ie < 8 endless up/down on close var id = "#ec1"; $(id).delay(5000).slideUp('fast'); } });

    Read the article

  • Is Oracle AQ/Streams of any use in my situation?

    - by RenderIn
    I'm writing a workflow system that is driven entirely at each step by explicit human interaction. That is, a task is assigned to a person, that person selects from a few limited options {approve, reject, forward}, and then it is either sent along to the next person or terminated. Just curious of Oracle Streams/AQ has anything to offer over flat tables managed by regular web application code. The amount of processing after each action is fairly limited and the volume is not terribly high, so there's not really a need to throttle things by throwing them into a queue. What are some of the benefits of introducing a queue structure, or is it overkill for my situation?

    Read the article

  • jQuery: Counter, Tricky problem with effects for brainy people.

    - by Marius
    Hello there! I made this counter that I think is cool because it only makes visible changes to the numbers being changed between each time it is triggered. This is the code // counter $('a').click(function(){ var u = ''; var newStr = ''; $('.counter').each(function(){ var len = $(this).children('span').length; $(this).children('span').each(function(){ u = u + $(this).text(); }); v = parseInt(u) + 1; v = v + ''; for (i=v.length - 1; i >= 0; i--) { if (v.charAt(i) == u.charAt(i)) { break; } } slce = len - (v.length - (i + 1)) updates = $(this).children('span').slice(slce); $(updates).fadeTo(100,0).delay(100).each(function(index){ f = i + 1 + index; $(this).text(v.charAt(f)); }).fadeTo(100,1); }); }); Markup: <span class="counter"> <span></span><span></span><span></span><span></span><span></span><span></span><span style="margin-right:4px;">9</span><span>9</span><span>9</span><span>9</span> </span> <a href="">Add + 1</a> The problem is that I previously used queue() function to delay() $(this).text(v.charAt(f)); by 100ms, (without queue the text()-function would not be delayed because it isnt in the fx catergory) so that the text would be updated before the object had faded to opacity = 0. That would look stupid. When adding multiple counters, only one of the counters would count. When removing the queue function, both counters would work, but as you can imagine, the delay of the text() would be gone (as it isnt fx-category). It is probably a bit tricky to make out how I can have multiple counters, and still delay the text()-function by 100ms, but I was hoping there is somebody here with spare brain capacity for these things ;) You can see a (NSFW) problem demo here: Just look underneath the sharing icons and you will notice that the text changes WHILE the objects fade out. Looking for some help to sove this problem. I would like to call the text() function once the text has faded to opacity 0, then fade in once the text() has executed. Thank you for your time.

    Read the article

  • C# Thread Queue Synchronize

    - by ikurtz
    Greetings, I am trying to play some audio files without holding up the GUI. Below is a sample of the code: if (audio) { if (ThreadPool.QueueUserWorkItem(new WaitCallback(CoordinateProc), fireResult)) { } else { MessageBox.Show("false"); } } if (audio) { if (ThreadPool.QueueUserWorkItem(new WaitCallback(FireProc), fireResult)) { } else { MessageBox.Show("false"); } } if (audio) { if (ThreadPool.QueueUserWorkItem(new WaitCallback(HitProc), fireResult)) { } else { MessageBox.Show("false"); } } The situation is the samples are not being played in order. some play before the other and I need to fix this so the samples are played one after another in order. How do I implement this please? Thank you.

    Read the article

  • Queue-like data structure with fast search and insertion

    - by Max
    I need a datastructure with the following properties: It contains integer numbers, no duplicates. After it reaches the maximal size the first element is removed. So if the capacity is 3, then this is how it would look when putting in it sequential numbers: {}, {1}, {1, 2}, {1, 2, 3}, {2, 3, 4}, {3, 4, 5} etc. Only two operations are needed: inserting a number into this container (INSERT) and checking if the number is already in the container (EXISTS). The number of EXISTS operations is expected to be approximately 2 * number of INSERT operations. I need these operations to be as fast as possible. What would be the fastest data structure or combination of data structures for this scenario?

    Read the article

  • SQL Agent Job - to execute as queue

    - by BINEESHTHOMAS
    I have a job which is calling 10 other jobs using sp_start_job. The job is having 10 steps, each step calling each sub jobs, When i execute the main job, i can see it started with step 1 and in a few secods it shows 'finished successfully' But the jobs take long time time, and when i see the log mechanism i have put inside , it shows the all the 10 steps are running simultaniously at the back, till it finishes after few hours. My requirement is, it should finish step 1 first and then only step2 should start. aNY HELP PLS ?

    Read the article

  • Whats the best method for queuing time-sensitive messages with PHP/MySQL?

    - by Mike Diena
    I'm building an SMS call and response system in a new app that receives a message via an aggregator gateway, checks it for functional keywords (run, stop, ask, etc), then processes it appropriately (save to the database, return an answer, or execute a task based on the users authorization). It's running fine at the moment as there are only a few users, but I figure its going to have more issues as we scale it up. We're currently running it on a single DV machine (mediatemple base dv). My question is this: does it make more sense to set something up like Memcached to run a queue, or a simple database with a daemon running to process each message one by one? I don't have much experience with either, so any advice would be helpful. Since the messaging is somewhat time-sensitive, what would be the fastest and most reliable way to handle this? Also, since we're sending responses, I'll probably need to set up and outbound message queue as well. Would it make sense to use the same concept for both?

    Read the article

  • Current tasks count at Appengine Task Queue

    - by splix
    Are there any ways to get count of current unfinished tasks at Google Appengine development server? I need it for making my integration test. I found a way to get this when running it local (just in mem), as described at appengine docs. But when i'm running it as a standalone server, from maven, this doesn't work. Just because library appengine-testing conflicts with Appengine SDK classes, and i can't use those classes together, when running sdk dev server.

    Read the article

  • Process xml-like log file queue

    - by Zsolt Botykai
    Hi all, first of all: I'm not a programmer, never was, although had learn a lot during my professional carreer as a support consultant. Now my task is to process - and create some statistics about a constantly written and rapidly growing XML like log file. It's not valid XML, because it does not have a proper <root> element, e.g. the log looks like this: <log itemdate="somedate"> <field id="0" /> ... </log> <log itemdate="somedate+1"> <field id="0" /> ... </log> <log itemdate="somedate+n"> <field id="0" /> ... </log> E.g. I have to count all the items with field id=0. But most of the solutions I had found (e.g. using XPath) reports an error about the garbage after the first closing </log>. Most probably I can use python (2.6, although I can compile 3.x as well), or some really old perl version (5.6.x), and recently compiled xmlstarlet which really looks promising - I was able to create the statistics for a certain period after copying the file, and pre- & appending the opening and closing root element. But this is a huge file and copying takes time as well. Isn't there a better solution? Thanks in advance!

    Read the article

  • Messaging strategies to connect different systems

    - by n002213f
    I have a system to handle Applications online and a different system to send SMS/Email notifications to applicants on completion using web services. I can't guarantee the availability of the SMS/Email gateway. Option 1 After an application is complete, place a message on a JMS queue. A Message Driven bean receives the message and make a call for the web service, if it fails leave the message on the queue. I suspect (please correct if incorrect) that if the gate way is offline the continuosly try to send the message which might use up valuable resources. Can the above option be refined are are there any other messaging strategies that can be used?

    Read the article

  • GAE Task Queue rate

    - by bach
    Hi, Is there a way to guarantee a task to be performed in X minutes (or after X min) ? (rate would mean the intervals between tasks but what about the first task, would the first task starts after the 'rate' time?)

    Read the article

  • Queue access to the database to avoid multiple cache items

    - by MikeJ
    I have a music related ASP.NET web site which caches a lot of static information from the database on the first request. Sometimes, the application is reset and cache is cleared while the application is on heavy load and then all http requests go to the database to retrieve that static data and cache it for other requests. How can I ensure that only one request go to the database and cache the results, so that other request simply read that info from cache and not needlessly retrieve the same info over and over again. Can I use thread locking? For example, can I do something like lock(this) { db access here }?

    Read the article

  • How can I run a function anytime anything is animated with jQuery?

    - by WillyCornbread
    Hi - I have some jQuery animations in my code to slide divs up and down in response to some mouse clicks and other logic. This is all working just peachy, however in IE 6 some of the smaller icon images on the page don't slide along with the rest of the div for some strange reason. They kind of stay put then flicker into the new position and I've chalked this up to an IE6 'feature'. Considering that I have to support IE6, I wanted to just hide the icons anytime an animation started, and show them again when the queue was empty. I couldn't find a reference to any kind of events or hooks into the queue itself and I'd rather not add the hide code, then the show code to every animation as a callback. Thanks if you can help- b

    Read the article

  • .NET Performance: Deep Recursion vs Queue

    - by JeffN825
    I'm writing a component that needs to walk large object graphs, sometimes 20-30 levels deep. What is the most performant way of walking the graph? A. Enqueueing "steps" so as to avoid deep recursion or B. A DFS (depth first search) which may step many levels deep and have a "deep" stack trace at times. I guess the question I'm asking is: Is there a performance hit in .NET for doing a DFS that causes a "deep" stack trace? If so, what is the hit? And would I better better off with some BFS by means of queueing up steps that would have been handled recursively in a DFS? Sorry if I'm being unclear. Thanks.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >