queue

How can I hook an application's main thread message queue processing on Windows CE

I have a Windows CE application that is targeted at several (well two) different windows CE devices. The application is developed in Visual studio 2005 using C++ & MFC (no .NET). One of the devices signals system shutdown to running apps. by posting a custom message to the apps. main thread message queue using the PostThreadMessage() A...

Sql Server Service Broker: How to structure Conversations for a simple queue scenario?

I'm a Sql Server Service Broker novice and I'm trying to grasp the best way to set Service Broker up for a (seemingly) simple use case: I want to create a simple work queue, where one application drops work items into the queue, and separate application picks up work items from that queue and processes them. There is no need for the firs...

What is the symbol for a queue?

In a flowchart or process diagram, what is the symbol for a FIFO queue? ...

limit size of Queue<T> in C++

I notice the thread of similar question: http://stackoverflow.com/questions/1292/limit-size-of-queuet-in-net That's exactly what I want to do, but I am not using .net but GNU C++. I have no reference to the base class in GNU C++, so java like super.() or .net like base.() will not work. I have been trying to inherite from queue class but...

Is it possible to stop touches from getting added to the queue?

Hi, I have disabled interactions in my primary view (which contains some subviews I use as buttons). I keep this disabled while I have a secondary view up indicating network activity (loading data). When it is finished, I re-enable interactions in the primary view. This is so the user isn't tapping those buttons while the network oper...

Best way to obtain indexed access to a Python queue, thread-safe

I have a queue (from the Queue module), and I want to get indexed access into it. (i.e., being able to ask for item number four in the queue, without removing it from the queue.) I saw that a queue uses a deque internally, and deque has indexed access. The question is, how can I use the deque without (1) messing up the queue, (2) breaki...

Queue that uses a Stack

I am having trouble understanding a question. The question asks first to write a C++ class to represent a stack of integers. Done. Here are my prototypes: class Stack{ private: int top; int item[100]; public: Stack() {top = -1;} ~Stack(); void push(int x) {item[++top] = x;} int pop() {return item[top--];} int...

Python: Why are some of Queue.queue's method "unreliable"?

In the queue class from the Queue module, there are a few methods, namely, qsize, empty and full, whose documentation claims they are "not reliable". What exactly is not reliable about them? I did notice that on the Python docs site, the following is said about qsize: Note, qsize() > 0 doesn’t guarantee that a subsequent get() wi...

Java Queue implementations, which one ?

From javadoc: A ConcurrentLinkedQueue is an appropriate choice when many threads will share access to a common collection. This queue does not permit null elements. ArrayBlockingQueue is a classic "bounded buffer", in which a fixed-sized array holds elements inserted by producers and extracted by consumers. This class supports an optio...

Pre-allocate space for C++ STL queue

I'm writing a radix sort algorithm using queues and I would like to have a STL queue allocate space before I start adding things to the queue so that I can avoid constant dynamic resizing operations. Even though this doesn't exist, I want something with the effect of... queue<int> qs(N); for(int i=0;i<N;++i) qs.push(rand()); in su...

How would you obtain the first and last items in a Queue?

Say I have a rolling collection of values where I specify the size of the collection and any time a new value is added, any old values beyond this specified size are dropped off. Obviously (and I've tested this) the best type of collection to use for this behavior is a Queue: myQueue.Enqueue(newValue) If myQueue.Count > specifiedSize Th...

jQuery build a queue with custom functions (not talking about fx queues)

This is my code... var _before = function () { for (var i = 0; i <= 10000; i++) { console.log(i); } }; var _appear = function () { console.log('i am in the middle of it'); }; var _after = function () { console.log('all done!'); }; jQuery.fn.doSomething = function() { this.click(function() { _before(); ...

jquery each function and queue

i have an array: arr = ['a', 'b', 'c', ... ] i want it to be: <div> <ul> <li>a <li>b <li>c ... </ul> </div> so i'm trying: $('div').append('<ul>'); $.each(arr, function () { $('div').append('<li>' + this); }); $('div').append('</ul>'); but doesn't seem working... how can i queue this? ...

Multiprocessing with renewable queue

I'm trying to figure out how to write a program in python that uses the multiprocessing queue. I have multiple servers and one of them will provide the queue remotely with this: from multiprocessing.managers import BaseManager import Queue import daemonme queue = Queue.Queue() class QueueManager(BaseManager): pass daemonme.creat...

Multi-threaded Queue in C#

I've been tasked with working on a download queuing system but I'm a bit confused about where to start. Essentially what we need to do is to have something like a download manager (but not as fully blown). We have about 20-100 files to download, we give the user a UI (with a listview) to allow them to pause, stop, or move the priorty of...

How do I program a queue to launch external applications in ASP.NET?

Using C# ASP.NET I want to program a queue. I want to have X number of a process. When it finishes it should take the next item on the list and process it. I figure the most simple way is to insert and delete it from an SQL database. My problem is: How do I start this when I add the first item? Do I launch a separate thread? AFAIK every...

Maximum size of Actor Queues?

I'm considering using Actors in a system to wrap some storage (could be a database, could be an in-memory collection). The reason I want to do this is because I don't want calls to the store to be blocking from the code that's calling it and I intend to push a high volume of messages through. Could an actor's inbound message queue handl...

How to prevent SlideToggle function queue?

Case: Jquery code manage a sliding EM tag (with slideToggle function) for its appearing on hover. Problem: The slideToggle sometimes queue the hover state. I referred to this article: http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup I tried to insert stop() function, but this not affect slideToggle(); But...

Need a queue that can support multiple readers

I need a queue that can be processed by multiple readers. The readers will dequeue an element and send it to a REST service. What's important to note are: Each reader should be dequeueing different elements. If the queue has elements A, B & C, Thread 1 should dequeue A and Thread 2 should dequeue B in concurrent fashion. And so forth...

LinkedBlockingQueue vs ConcurrentLinkedQueue

My question relates to this question asked earlier. In situations where I am using a queue for communication between producer and consumer threads would people generally recommend using LinkedBlockingQueue or ConcurrentLinkedQueue? What are the advantages / disadvantages of using one over the other? The main difference I can see from ...