queue

Thread-safe blocking queue implementation on .NET

Hello. I'm looking for an implementation of thread-safe blocking queue for .NET. By "thread-safe blocking queue" I mean: - thread-safe access to a queue where Dequeue method call blocks a thread untill other thread puts (Enqueue) some value. By the moment I'v found this one: http://www.eggheadcafe.com/articles/20060414.asp (But it's for...

How does MSMQ manage messages?

It seems that MSMQ doesn't use any Database management system to manage messages. How does MSMQ manage messages? Does it store the messages in flat file? I'm trying to implement a messages management system. It's my exercise. ...

Where is the Queue class in the Java Collections?

I only see a Queue interface, is there no Queue class in the Java Collections? ...

How do I make and use a Queue in Objective-C?

I want to use a queue data structure in my Objective-C program. In C++ I'd use the STL queue. What is the equivalent data structure in Objective-C? How do I push/pop items? ...

Any open source message queue that can be used to send messages from COBOL to Java?

I have a Java stack (Tomcat, etc) and I need to send messages from a mainframe running COBOL to the Java end. Any of the open source queues available can do that? ...

Getting started with cron jobs and PHP (Zend Framework)

I am totally new to the subject of cron jobs so I have no idea where to start learning about them; when, why, or how to use them with my Zend Framework application, or PHP in general. Can anyone explain the process, with an example, or recommend some good resources to get started? ...

Java thread wait and notify

I have two threads. Thread A is pulling some elements from queue and thread B is adding some elements to the queue. I want thread A to go to sleep when the queue is empty. When thread B adds some element to the queue it should make sure that thread A is working. How can this be done in Java? ...

What are the advantages of Blocking Queue in Java?

I am working on a project that uses a queue that keeps information about the messages that to be sent to remote hosts. In that case one thread is responsible to put the information into the queue and another thread is responsible for get the pop the information from the queue and send. In that case the 2nd thread needs to check the queue...

Minimal "Task Queue" with stock Linux tools to leverage Multicore CPU

What is the best/easiest way to build a minimal task queue system for Linux using bash and common tools? I have a file with 9'000 lines, each line has a bash command line, the commands are completely independent. command 1 > Logs/1.log command 2 > Logs/2.log command 3 > Logs/3.log ... My box has more than one core and I want to execu...

How to insert a "Pair" or n-size into a list collection instead of composing HashMaps?

So, I have a situation where I need to pass in three values into a serial BlockingQueue queue: (SelectableChannel, ComponentSocketBasis, Integer). They don't actually need to be hash mapped at all, and to use a HashMap is ridiculous as there will always be only one key for each entry; it'd be fine if they were just in some sort of o...

Queue SQL implementation with a single query.

I have an SQL table that looks like: TABLE QUEUE ID DATA POSITION Field POSITION holds the potition of the record relative to a Queue. So, it can be: 0 not in any position (not queued). 1 first in the queue (next in line). > 1 the position in the queue. I need a (MS) SQL query that will move the queue up one position...

is breadth first search or breadth first traversal possible without using a queue?

as i rememeber and checked, that the usual way for traversing a tree or crawling the web breadth first (BFS) is by using a queue. Is there actually a way to implement it not using a queue? ...

Run PHP Task Asynchronously

I work on a somewhat large web application, and the backend is mostly in PHP. There are several places in the code where I need to complete some task, but I don't want to make the user wait for the result. For example, when creating a new account, I need to send them a welcome email. But when they hit the 'Finish Registration' button, I ...

ORA-01031: insufficient privileges creating JMS connection to Oracle topic

One of my colleagues is having an issue creating a (non-durable) subscriber to an Oracle queue from Java. The queue is owned by one schema (say OWNER); he's trying to connect as another user (say SUBSCRIBER). SUBSCRIBER has been granted DEQUEUE privileges (and ENQUEUE, for what it's worth) by OWNER. When he creates the queue with the ...

simple implementation of queue

I have the following queue class (taken from wordpress): #include<iostream.h> class Queue { private: int data; Queue*next; public: void Enque(int); int Deque(); }*head,*tail; void Queue::enque(int data) { Queue *temp; temp=new Queue; temp->data=data; temp->next=NULL; if(heads==NULL) heads=temp; else tail->next=temp; tail=tem...

two queue into one queue

the question here is the reverse of it, using two queues Q1 :A1,A2, A3 Q2: B1, B2, B3 . Given two queues with their standard operations (enqueue, dequeue, isempty, size), and want to merge them to newQ: like A1,B1,A2,B2 and so on...till the both Qs are empty I am interested in the algorithm more than any specific language implementatio...

jquery simple menu roll-over (animation queue question)

I have a simple unordered list with listitems as menu item i created the jquery just to have a funny rolover effect beeing: $('#nav ul ul li').hover(function(){ $(this).animate({ marginLeft: "20px", }, 300 ); }, function(){ $(this).animate({ marginLeft: "0px", }, 300 ); }); the problem with this script i...

Blocking Queue - Need more information..

This question is related with one of my earlier questions.. Previous Post In there the blocking nature is mentioned as an advantage. I tried to develop some simple code to demonstrate the blocking nature but I got stuck. I just tried to make a BlockingQueue of size 4 and tried to add 5 elements and ended up with a java.lang.IllegalSta...

Thread-safe async byte queue

I've got a callback method that is called whenever new data is available: public delegate void DataCallback( byte[] buffer, int offset, int count); I want to wrap this in a class that implements an interface similar to this: public interface IDataSource { IAsyncResult BeginRead( byte[] buffer, int offs...

C++ - threads and multiple queues

I need to build a system of workers (represented as threads) and (multiple) queues. Individual jobs are waiting in one of the queues and waits for a worker thread to process them. Each worker can process jobs only from some of the queues. No spin-waiting. C/C++, pthreads, standard POSIX. The problem for me is the "multiple queues" thing...