queue

What's the fastest Perl IPC/message queue for a single machine?

I'm working on a (primarily) Perl project and want to use a message queue to isolate processes from each other. I have a work flow like this: Input -> Receiver -> Processor(s) -> Output(s) I need to handle several hundred transactions/second, so speed my biggest motivator. What is the fastest message queue system for this type of setup...

Do any Java libraries provide a random access Queue implementation?

I'm implementing a sliding window over a stream of events, in Java. So I want a data structure which allows me to do the following: add to the end of the data structure when new events occur; remove from the start of the data structure when old events are processed; get standard random access (size(), get(i)) to the elements of the dat...

PHP + MySQL Queue

I need a simple table that acts as a Queue. My MySQL server restriction is I can't use InnoDB tables, only MyISAM. Clients/workers will work at the same time and they will need to receive differents jobs each time. My idea is to do the following (pseudo-code): $job <- SELECT * FROM queue ORDER BY last_pop ASC LIMIT 1; UPDATE queue SET...

PHP + MySQL Cycle Queue

I just accepted a similar question (http://stackoverflow.com/questions/1690748/php-mysql-queue), but I realized that it wasn't the correct question for my problem, but was the correct answer for my question :) I have a MySQL (MyISAM type) table of sites to be scraped by workers. CREATE TABLE `site` ( `id` int(11) NOT NULL auto_increm...

Problem with priority_queue - Writing memory after heap

Hello again, I am trying to use priority_queue, and program constantly fails with error message HEAP CORRUPTION DETECTED. here are the snippets: class CQueue { ... priority_queue<Message, deque<Message>, less<deque<Message>::value_type> > m_messages; ...}; class Message has overloaded operators > and < Here I fill up ...

Threading in Ruby with a limit

I have a task I need to perform, do_stuff(opts), that will take ~1s each, even while 1 - 10 of them are running in parallel. I need to collect an array of the results for each operation at the end. If I have 30 stuffs to do, how would I use threading effectively to queue up the do_stuff(opts) operations so no more than 10 are running co...

jQuery - How to sequentially run an animation * only once * after animation on a group (e.g. siblings)

Here's my dilema. I have 2 animations that need to run sequentially. The first animation runs on a group of elements acquired through jQuery's siblings() function. The second animation runs on a single element. (The one upon which siblings() was called.) This needs to take place after the first animation has finished. If I don't use q...

Insert into an STL queue using std::copy

Hi, I'd like to use std::copy to insert elements into a queue like this: vector<int> v; v.push_back( 1 ); v.push_back( 2 ); queue<int> q; copy( v.begin(), v.end(), insert_iterator< queue<int> >( q, q.front() ) ); But this fails to compile, complaining that 'begin' is not a member of 'std::queue'. Note: I tried it with std::inserter...

How do I build a lockless queue?

Hi, I've spent today looking into lockless queues. I have a multiple producer, multiple consumer situation. I implemented, for testing, a system using the Interlocked SList thing under Win32 and it doubled the performance of my heavily threaded task based code. Unfortunately, though, I wish to support multiple platforms. Interlockin...

how bad is it to use dynamic datastuctures on an embedded system?

So IN an embedded systems unit, that i'm taking at uni next year, we will learn that dynamic data structures are a bad thing to have in an embedded system program. but the lecture notes don't go into why. Now i'm working on a moderate scale, embedded systems\ 'LURC' controller, mostly just takes advantages of the peripheral of the "Butt...

Thread & Queue vs Serial performance

I though it'll be interesting to look at threads and queues, so I've written 2 scripts, one will break a file up and encrypt each chunk in a thread, the other will do it serially. I'm still very new to python and don't really know why the treading script takes so much longer. Threaded Script: #!/usr/bin/env python from Crypto.Cipher ...

Delphi thread that waits for data, processes it, then resumes waiting

I need to create a thread in Delphi with the following characteristics: Waits until the main thread adds data to a shared queue. Processes all the data in the queue, returning the results to main thread (for this last part I'll just send messages to the main window). Processing is time-consuming, so new data may be added to the queue w...

Maximum number of messages sent to a Queue in OpenMQ ?

I am currently using Glassfish v2.1 and I have set up a queue to send and receive messages from with Sesion beans and MDBs respectively. However, I have noticed that I can send only a maximum of 1000 messages to the queue. Is there any reason why I cannot send more than 1000 messages to the queue? I do have a "developer" profile setup fo...

Efficient queue in Haskell.

How can I efficiently implement a list data structure where I can have 2 views to the head and end of the list, that always point to a head a tail of a list without expensive calls to reverse. i.e: start x = [] end x = reverse start -- [] start1 = [1,2,3] ++ start end start1 -- [3,2,1] end should be able to do this without invoking 'r...

Locking a queue while re-ordering it in Coldfusion

Hi all, please consider the following: I have a queue of objects represented as an array. I process them off the top of the array (at position 1) before calling arrayDeleteAt() to remove it from the array. I add new queue item at the top of the array using arrayAppend(). This works fine. However, I now wish to re-order the array im...

java BlockingQueue does not have a blocking peek?

I have a blocking queue of objects. I want to write a thread that blocks till there is a object on the queue. Similar to the functionality provided by BlockingQueue.take(). However, since I do not know if I will be able to process the object successfully, I want to just peek() and not remove the object. I want to remove the object only...

Java Queue Merge, Beginner

I'm trying to write a method that will take in two Queues (pre-sorted Linked Lists) and return the merged, in ascending order, resulting Queue object. I pasted the Queue class, the merge method starts 1/2 way down. I'm having trouble calling merge, this is how I am trying to call it from my main method, can anyone help with this call ...

Javascript HTTP Request Queue within object variable - initialization doesn't work

Hi folks, I got the following Request Queue implementation from this blog: http://dsgdev.wordpress.com/2006/10/28/building-a-javascript-http-request-queue/ and want to wrap it with a object variable. Unfortunately the variable initialization inside doesn't work. Hope someone can help me with this stuff. Thanks in advance var reque...

Queueing functions and Ajax in jQuery

Hello, I've got two functions and one problem. hideTable(); ajaxCall(params); The function hideTable function hideTable() { if (effects) { $('#jquerytable tbody').fadeOut(speed); } } I want the ajaxCall function to be executed after the hideTable function (which takes a little time). The showTable function should be e...

C# put thread to sleep on dequeue?

I'm trying to use WebClient to download a bunch of files asynchronously. From my understanding, this is possible, but you need to have one WebClient object for each download. So I figured I'd just throw a bunch of them in a queue at the start of my program, then pop them off one at a time and tell them to download a file. When the file i...