queue

ObservableQueue?

Has anyone written a version of .Net's generic Queue that implements INotifyCollectionChanged, or is there one hidden deep in the .Net framework somewhere already? ...

Best Collection To Use?

Hi There, I am reading log files but not all lines want to be processed straight away. I am using a queue / buffer to store the lines while they wait to be processed. This queue is regularly scanned for particular lines - when they are found, they are removed from the queue (they can be anywhere in it). When there isn't a particular li...

WCF and MSMQ failure handling

Can someone explain to me the difference between these 3 approaches to processing messages that fail delivery? Poison Queue service Dead-Letter Queue service Using a response service to handle failures I have "Programming WCF", but I don't really understand when you would use one of these over another, or when it would make sense to ...

Program to simulate vehicles at an intersection using queues

HI I got this coursework question to solve. This is the question: Design a program to simulate vehicles at an intersection. Assume that there is one lane going in each of four directions, with stoplights facing each direction. Vary the arrival time of vehicles randomly in each direction and set up a regular frequency of the light cha...

Calculating a moving average in F#

I'm still working on groking the F# thing - trying to work out how to 'think' in F# rather than just translating from other languages I know. I've recently been thinking about the cases where you don't have a 1:1 map between before and after. Cases where List.map falls down. One example of this is moving averages, where typically you w...

Java Collections (LIFO Structure)

Hi, I am looking in the Collections framework of Java for a LIFO Structure (Stack) without any success. Basically I want a really simple stack; my perfect option would be a Deque, but I am in Java 1.5. I would like not to have to add another class to my structure but I am wondering if that is possible: Is there any class in the Collec...

ASP.NET - best queue system for a new application

My organization is getting ready to implement a new system, which is a asp.net application. The application will have a large queue of offline work that is initiated by the website. This queue will hold different types of activity, ideally in XML messages. Think of things like email notifications, scheduled tasks, etc. In the past, t...

In C# would it be better to use Queue.Synchronized or lock() for thread safety?

I have a Queue object that I need to ensure is thread-safe. Would it be better to use a lock object like this: lock(myLockObject) { //do stuff with the queue } Or is it recommended to use Queue.Synchronized like this: Queue.Synchronized(myQueue).whatever_i_want_to_do(); From reading the MSDN docs it says I should use Queue.Synchron...

MS CRM 4 - Get queue that a case assigned to

Hello there. I am looking for a solution to my problem. Is there a way to grab the value of the queue that a user assigns a case to on the case form. I would like to add the queue name to a custom attribute for further use during the save. I am using CRM 4 enterprise Thanks J ...

Array of Queues in VB.Net

Probably a very dumb question, but I want to create an array of queues in vb.net - so I can reference each queue with an index: eg commandQueue(1).enqueue("itemtext") commandQueue(2).enqueue("othertext") where commandQueue(1) refers to a separate queue than commandQueue(2) I've got all tangled up trying to define an object array an...

VB.NET queue processing question

Hi, I need a VB.NET Forms application that processes a queue. It basically needs to ping a web service every 30 seconds and then load documents into a document management system, if there are any to load. How would I implement this? Using a loop? Do I need to look into threads? Thanks ...

Is it possible to avoid a wakeup-waiting race using only POSIX semaphores? Is it benign?

I'd like to use POSIX semaphores to manage atomic get and put from a file representing a queue. I want the flexibility of having something named in the filesystem, so that completely unrelated processes can share a queue. I think this plan rules out pthreads. The named posix semaphores are great for putting something in the filesystem...

Where should you use BlockingQueue Implementations instead of Simple Queue Implementations ?

I think I shall reframe my question from Where should you use BlockingQueue Implementations instead of Simple Queue Implementations ? to What are the advantages/disadvantages of BlockingQueue over Queue implementations taking into consideration aspects like speed,concurrency or other properties which vary e.g. time to access last el...

How can I run the first process from a list of processes stored in a file and immediately delete the first line as if the file was a queue and I called "pop"?

I'd like to call the first command listed in a simple text file with \n as the separator in a pop-like fashion: Figure 1: cmdqueue.lst : proc_C1 proc_C2 proc_C3 . . Figure 2: Pop the first command via popcmd: proc_A | proc_B | popcmd cmdqueue.lst | proc_D Figure 3: cmdqueue.lst : proc_C2 proc_C3 proc_C4 . . ...

MSMQ - Workgroup mode - Windows Server 2003 - private queue - WCF service never notified when post new message

Hi, I'm using WCF (C#) to send/receive messages from private msmq queue under Windows Server 2003 in WorkGroup mode. Client WCF/Service WCF and MSMQ are on the same computer. There's one client that send message to the private queue, that's work perfect. There's one service that receive message from the same private queue but the servic...

Queues in the Linux Kernel

I've been searching for information for a common kernel implementation of queues, that is, first-in-first-out data structures. I thought there may be one since it's likely something that's common to use, and there's a standard for linked lists (in the form of the list_head structure). Is there some standard queue implementation I can't...

Messaging, Queues and ESB's - I know where I want to be but not how to get there!

Hi, To cut a long story short, I am working on a project where we are rewriting a large web application for all the usual reasons. The main aim of the rewrite is to separate this large single application running on single server into many smaller decoupled applications, which can be run on many servers. Ok here's what I would like: I ...

PHP calling multiple videos to convert at once via mencoder.How can I limit it?

Hello all, I am new here. I recently installed my video script to a new server but I am seeing that it will start to convert 1 video (via mencoder) then before finishing it, it will try and convery another, and another, so it will be trying to convert 4+ videos at the same time causing the server to shut down. The script developer said:...

A generic priority queue for Python

Hello, I need to use a priority queue in my Python code. Looking around for something efficient, I came upon heapq. It looks good, but seems to be specified only for integers. I suppose it works with any objects that have comparison operators, but it doesn't specify what comparison operators it needs. Besides, heapq seems to be implem...

java.util.ConcurrentLinkedQueue

I want to use java.util.ConcurrentLinkedQueue as a non-durable queue for a Servlet. Here's the blurb from the javadoc for the class. An unbounded thread-safe queue based on linked nodes. A ConcurrentLinkedQueue is an appropriate choice when many threads will share access to a common collection. This queue does not permit null element...