queue

Critique my concurrent queue

This is a concurrent queue I wrote which I plan on using in a thread pool I'm writing. I'm wondering if there are any performance improvements I could make. atomic_counter is pasted below if you're curious! #ifndef NS_CONCURRENT_QUEUE_HPP_INCLUDED #define NS_CONCURRENT_QUEUE_HPP_INCLUDED #include <ns/atomic_counter.hpp> #include <boost...

Message queue, c++ multi thread

Hi, I looking for cross platform multithread message queue implementation on c++ (not slot/signal) . Better if it based on subject-observer pattern. ...

How do you pass a Queue reference to a function managed by pool.map_async()?

I want a long-running process to return its progress over a Queue (or something similar) which I will feed to a progress bar dialog. I also need the result when the process is completed. A test example here fails with a RuntimeError: Queue objects should only be shared between processes through inheritance. import multiprocessing, time ...

What are some good technologies in .NET that allow for queueing / dequeuing xml strings?

We are currently using a custom queueing system where a table in a SQL Server 2008 database has an xml column with some additional data. We use this when we serialize our objects to XML and store them in this table. Later, another application simply dequeues these items, deserializes them into the same object and preforms a certain task ...

Animate returned elements from each() in order

I'm using this script to animate some images inside anchors: $('#locations a').each(function() { // set opacity 0 take initial position $(this).css('opacity', '0'); var left = $(this).css('left'); var top = $(this).css('top'); // reset position and animate $(this).css({'left' : '0', 'top'...

iPhone: Load Queue on Startup

I've not found a answer to this question anywhere, but this seems like a typical problem: I would like to send some POST-Requests (with ASIHTTPRequest, what I already do), but if something goes wrong, ther user can decide to "Try Later", that means, the task should be put on a queue and this queue should be read next time the applicatio...

Is there a way to reduce the memory use of this queue?

In liberal C: /* i'm using this */ struct QueueItem { QueueItem* next; void* data; } struct Queue { QueueItem* head; QueueItem* tail; } /* +---+ +---+ |0 0| |* *| len 1 +---+ +|-|+ v v len +---+ 0 |d 0| +---+ +---+ |* *------...

How to repeat or loop this queue on jQuery?

Hi, This is code for a faded slideshow. Is there a way to repeat or loop this queue? To start again on this top code $("#page2_image").hide(); Here's the code in jQuery: $(document).ready(function(){ $("#page2_image").hide(); $("#page3_image").hide(); $("#page1_image").fadeOut(10000); $("#page2_image").fadeIn(10000).fadeOu...

Efficient C# byte queue for parsing stream of bytes for binary message packets

Hi, I'm trying to replace what I would usually implement as a circular-buffer+. The function of the queue is to buffer incoming bytes (eg. from serial port or some other stream of data), whilst a parser examines bytes in the queue and detects and extracts message packets. Criteria: can grow (ie not fixed-sized) >= 1 bytes can be e...

How is the memory use in a queue ?

In my project I use the std::queue class. I would like to know what happen if I do the following. Get a a pointer of a element inside the queue (note: a pointer and not a iterator). I make modification in the queue like push and pop in the queue (pop element which is not the pointed by the previous pointer) Does my pointer still poin...

Priority Queues with Huffman tree

i am trying to create a Huffman tree by reading in a file and counting the frequency of each letter space symbol etc. i'm using a Priorityqueue to queue the items from smallest to largest but when i insert them into the queue they dont queue correctly here is my code. package huffman; import java.io.FileNotFoundException; import jav...

Creating a linked list or similar queue in MySQL?

I have a table of items that need to be displayed in a certain order, but that order can be changed. Items can be added at the beginning, end, or in the middle, and items can be rearranged. How can I set up the table to keep track of that order in such a way that it's easy to modify but the list can also be fetched in order with a sing...

How to put letters into a sendmail queue using PHP

I want to put letters into a queue instead of sending them instantly. Also, I need to track when letters are sent. I have this basic newsletter system, so before sending a letter I need to give each letter a sender ID (the newsletter user account ID) so I could track specifically what user has still letters pending to be sent. How could ...

What is the efficient way of implementing a queue?

What is the efficient way of implementing a queue, inorder to learn how it is implemented? EDIT: I looked into stl::queue code inorder to learn abt how it is implemented, but the template code making it difficult to understand. After all there is better efficient way is used than having a linked list. ...

Simple queuing system to manage frequent ajax call

I need to make a simple queuing system so that no more than 3 ajax calls are active at any given time. I am using jQuery. Can any one help me out. Thanks ...

Using mysql innodb as a queue?

I have two jobs pulling from a mysql table. They both want to get a row, do some work on it and update that row with the results, however I don't want them selecting the same row to update. Whats the best way using mysql/innodb engine to lock a row in the select so that it will be unavailable to other threads but allowing them to select ...

How to implement this Queue in a Jboss cluster?

Hello everybody, my application works as a middle ware, receiving requests from clients, then transforming it in certain logic and sending the transformed requests to another service provider as normal HTTP requests or Webservice soap requests. The application was deployed on two jboss servers (in cluster) behind a load balancer. let's...

Fading jQuery slideshow flicker / queue problem on mouseover (slideSwitch.js)

I've adapted code from the slideSwitch.js tutorial by Jon Raasch, which is basically a fading slideshow. The script promotes the 'active' slide to a higher z-index and animates the opacity for a fading effect. It's working fine with a pause added to stop the slideshow temporarily on mouseover. The issue I'm having is I'm trying to stop...

implementing a basic queue/thread process within python

hi.. looking for some eyeballs to verifiy that the following chunk of psuedo python makes sense. i'm looking to spawn a number of threads to implement some inproc functions as fast as possible. the idea is to spawn the threads in the master loop, so the app will run the threads simultaneously in a parallel/concurrent manner chunk of co...

how to deepcopy a queue in python.

Hi How to deepcopy a Queue in python? Thanks ...