queue

Adding objects to queue without interruption

I would like to put two objects into a queue, but I've got to be sure the objects are in both queues at the same time, therefore it should not be interrupted in between - something like an atomic block. Does some one have a solution? Many thanks... queue_01.put(car) queue_02.put(bike) ...

Quick look up of Data structures.

Hi, can i get the link to Quick look up of data structures.. ...

Design: Queue Management question (C#)

I want to build a windows service that will use a remote encoding service (like encoding.com, zencoder, etc.) to upload video files for encoding, download them after the encoding process is complete, and process them. In order to do that, I was thinking about having different queues, one for handling currently waiting files, one for fil...

What kind of python process to monitor a queueing system like kestrel or rabbitmq?

I'm fairly new to python, and I was wondering what kind of application would you create to constanstly monitor a queueing service like kestrel or rabbitmq? How would it run, and under what context? Would it be a simple python script that would have a infinit while loop? I'm looking for a long running, stable python service that would ...

Using a Queue<T> in a PropertyGrid...

I am using a Queue for a property, and it shows it as a collection in the propertygrid. The only issue, is I can't edit anything inside of it, it shows them as just "Objects" and everything is read only. I know Vector2 works fine in a propertygrid because I have a few of those by themselves. I've been googling, and found something abo...

Datastructure Interview Questions and answers

Hi, please post the possible data structure interview Questions and answers.. it will be helpfull for all who reffers this post. Thanks ...

Threads application terminates unexpectedly

I have little scraping application and trying to add multithreading to it. Here is code (MyMech is WWW::Mechanize subclass used to process HTTP errors): #!/usr/bin/perl use strict; use MyMech; use File::Basename; use File::Path; use HTML::Entities; use threads; use threads::shared; use Thread::Queue; use List::Util qw( max sum ); my $...

Can I read and write a FIFO from concurrent threads in .NET?

I'm using a Queue<T> for caching video. The idea is to fill it with data (Enqueue), start playing (Dequeue) and fill back continously as data arrives. Can I do the filling back part from a background thread? ...

Python multiprocessing handling sessions

I have a script receiveing data from a socket, each data contains a sessionid that a have to keep track of, foreach incomming message, i'm opening a new process with the multiprocessing module, i having trouble to figure out a way to keep track of the new incoming messages having the same sessionid. For example: 100100|Hello -- (open ...

C++ - LNK2019 error unresolved external symbol [template class's constructor and destructor] referenced in function _main

[[UPDATE]] -> If I #include "Queue.cpp" in my program.cpp, it works just fine. This shouldn't be necessary, right? Hey all -- I'm using Visual Studio 2010 and having trouble linking a quick-and-dirty Queue implementation. I started with an empty Win32 Console Application, and all files are present in the project. For verbosity, here's t...

Queue not working with thread?

Hi, I have the following code that retrieves the first element off a queue only if it has at least 2 elements. For some reason, it's not polling the first element. However, if I add a print statement in there, it will print and poll. The method is in a thread, and there's another thread adding element to the queue, this thread reads f...

V5 Messaging Provider with ListenerPort

I configured a queue and a QueueConnectionFactory using the V5 Messaging provider in WAS6.1. I also have a ListenerPort configured for this destination. Now it throws an exception when I try to connect to this queue using the queue connection factory or when the Message Listener listening to this ListenerPort starts up. javax.jms.JMSExc...

Major slowdown using NSInvocationOperation (NSOperation) with NSOperationQueue on iOS 4 (iPhone)

I have a lengthy operation O that is called through a NSInvocationOperation, itself scheduled by adding it to a NSOperationQueue so that it runs asynchronously. That lengthy operation O is invoked in two different cases in my app. In case A, operation O is invoked as a result of tapping some widget in some view. As soon as the widget is...

Queues implementation benchmark

I'm starting development of a series of image processing algorithms, some of them with intensive use of queues. Do you guys know a good benchmark for those data structures? To narrow the scope, I'm using C mostly, but I can use C++, stl and any library. I've got a few hits on data structure libraries, such as GLib and C-Generic-Library,...

Queue Simulation problem.

My program is to print the queue of information from a file but i have problem with my following code. When i run the program it keep loop. I cant figure out the problem. Any help? #include <iostream> #include <fstream> #include <string> #include <iomanip> #include <queue> #include <list> using namespace std; void simulation(ifstream &...

ZeroMQ based distributed system

Hi, In a distributed system with the following data flow: The client sends a message for a random node in the distributed system. The node checks if the operation can be performed by him. If not, sends the message to other node. And the process follows until the correct node. So the system has the following flow: client -> nodeX ->...

How would you architect this message processing system in .NET/SQL Server?

Let's say I've got a SQL Server database table with X (> 1,000,000) records in it that need to be processed (get data, perform external action, update status in db) one-by-one by some worker processes (either console apps, windows service, Azure worker roles, etc). I need to guarantee each row is only processed once. Ideally exclusivity ...

MSMQ: Enterprise library msmq listener and private remote queues - cannot send message

Hi all, I have following problem: I am trying to log messages to the remote private message queue. To do this I am using Enterprise library 5.0 and msmq trace listener in my application. Unfortunately, I always end up with the following error: Exception Type: System.Messaging.MessageQueueException MessageQueueErrorCode: IllegalFo...

Problem with Queue

Hi, I'm trying to make a program using the BFS algorithm so I put every node in a Queue and once every level is in the Queue I start comparing it to another node to see if they are equal or not, however the problem I'm having is that elements in my Queue are being modified so when I do the Dequeue I never get to an answer and I'm gettin...

Proper Queue threading technique in c#?

I wanted to implement a windows service that captures dropped flat delimited files to a folder for import to the database. What I originally envision is to have a FileSystemWatcher looking over new files imported and creating a new thread for importing. I wanted to know how I should properly implement an algorithm for this and what tec...