queue

C Queue programming problem.

I'm learning queues from a book. The author explains the operation of inserting an element in queue using the following code. #define MAX 100 char *p[MAX]; int spos = 0; // spos: holds the index of the **next free** storage location int rpos = 0;// rpos: holds the index of the next item to retrieve void qstore(char *q) { if(spos==MA...

Which implementation of circular queue is best?

I'm learning about circular queues. Which implementation of circular queue is best, the array implementation or linked list implementation? ...

Circular queue problem

I'm learning queues from a book. I've got into a problem while learning circular queue. The author from which I'm learning uses the following piece of code to explain how an element is inserted in a circular queue. #define MAX 100 char *p[MAX]; int spos = 0; // spos: holds the index of the **next free** storage location int rpos = 0;//...

Process Queue Timer

I want to scan a queue every 10 seconds using a Timer. If there are more then 0 items in this queue then Deque the first one, pass it as an argument to a Process and run that process. The timer should be disabled while this process executes. Once the process exits, it should re-enable the timer. The items in the queue can be added manua...

OpenCL Events and Command Queues

I'm working on translating a CUDA application (this if you must know) to OpenCL. The original application uses the C-style CUDA API, with a single stream just to avoid the automatic busy-wait when reading the results. Now I notice that OpenCL command queues look a lot like CUDA streams. But in the device read command, and likewise in ...

Background consumer thread lifetime management best practices

I have a C# class library which starts up a background consumer thread (lazily) which listens for tasks to complete from a producer/consumer queue. This class library can be used from any type of .NET application and is currently in use under an ASP.NET MVC web site. The consumer thread is blocked most of the time until a request comes i...

google app engine: problem getting objects from datastore in a task

My application constructs a Parent object in a static factory, along with it's predetermined Children, and then starts up tasks to run some computation on the Children, like so: public static Parent make(User owner, List<Integer> data, int size) { Parent result = new Parent(owner,data,size); PersistenceManager pm = Persi...

Output binary buffer with STL

I'm trying to use something that could best be described as a binary output queue. In short, one thread will fill a queue with binary data and another will pop this data from the queue, sending it to a client socket. What's the best way to do this with STL? I'm looking for something like std::queue but for many items at a time. Thanks ...

Threads, queue and workflow

(As justification - I've never worked with threads so the description below is just an idea I want you to criticize) The task overview: - There is a list of some Objects - We need to check if the object has been changed in some way - If it was changed - apply some logic (for example - show notify). This is how I think it should be impl...

python -> multiprocessing module

Hi all, Here's what I am trying to accomplish - I have about a million files which I need to parse & append the parsed content to a single file. Since a single process takes ages, this option is out. Not using threads in Python as it essentially comes to running a single process (due to GIL). Hence using multiprocessing module. i.e. s...

Download queue in iPhone

What's the best way to implement a download queue in iPhone? Can this be done with the ASIHTTPRequest library? ...

Communicating end of Queue

I'm learning to use the Queue module, and am a bit confused about how a queue consumer thread can be made to know that the queue is complete. Ideally I'd like to use get() from within the consumer thread and have it throw an exception if the queue has been marked "done". Is there a better way to communicate this than by appending a sen...

Can you export a Queue from Dynamics CRM?

Can you export a Queue from Dynamics CRM? I have a number of workflows that assign certain tasks to Queues for users to pick up later. There doesn't seem to be a way to export a Queue from CRM with the other customisations which means all the queues have to be setup again after a deployment. Am I just missing where to export Queues as...

possible memory leak?

i'm profiling the below code inside a singltone and found that a lot of Rate objects are kept in memory altough i clear them. protected void FetchingRates() { int count = 0; while (true) { try { if (m_RatesQueue.Count > 0) { List<RateLog> temp = null; lock (m_RatesQueue) { te...

Open source queuing theory algorithms in Java

I need to write a program to analyze the performance of computer systems and networks using queuing theory (http://en.wikipedia.org/wiki/Queueing_theory). I was wondering if there is an open source Java library implementing the various algorithms of queuing theory that can make my task easier. Does anyone have any recommendations? ...

Windows Azure - Web Role cannot access Local Development Queue Storage

I have a class library that is shared between multiple Role projects in my solution. Two of these projects are a Web Role and a Worker Role. They each have the same Configuration Setting: <Setting name="QueueConnectionString" value="UseDevelopmentStorage=true" /> each of them is making a call to this function: public static void Ad...

Service to process queued long-running processes - where to start?

What's the best way to build a service to handle queued long-running processes? For example, this is what we're trying to do User uploads 401k data to web Data goes into processing queue (a database table) 401k is processed (could take a couple minutes per client) User is informed via e-mail that 401k was accepted We could certainly...

[Jquery] How queque sending data via POST ?

Welcome, I have question. On my website i have form what allow user to submit data via POST (ajax). The problem is, when user submit field, ajax start request... if server is free, or user network is fast everything work very smooth. User can send messages very fast, and everything working. But if server is overloaded or user have slo...

Does the iOS SDK provide queues and stacks?

I'm writing an iPhone app, and I'm surprised that there seem to be no NSQueue or NSStack classes in Apple's Foundation Framework. I see that it would be quite easy to roll my own, starting with an NSMutableArray, so I'll do that unless I've missed something. Have I missed something? ...

Open Source Queue that works with Java, PHP and Python

I'm currently in the market for a new queue system for jobs we have in our system. I've tried beanstalk but it's been unable to keep up with the load. I'm looking for a simple system to get up and running that I can put pieces of data in from producers and have consumers in Java, PHP and Python pull data off and process it. Ideally I'd...