queue

EnumJobs not returning Copies & Total Pages

I'm using Windows API's EnumJobs to find the PageCount and Copies of a print job, but I found that these fields are almost always zero when called on a print server. Although it could be my timing is out, because the number of pages increment as the job prints and once it's done the print job cannot be accessed. So there is about half a...

[ERLANG] Priority send and receive

I have a problem that I wonder if it can be efficiently implemented in ERLANG. I have a bunch of nodes communicating with each other using a protocol that adds priority information to messages. I would like to be able to send the highest priority messages first (at the sender) and handle them first at the receiver, before the lower-prio...

Basic question about request queues in IIS / ASP.Net

I have an ASP.Net application running under IIS 6. A simple page has two radio buttons and a submit button. If I select radio button "A" and submit the page, a lengthy PDF file is generated, which takes about a minute to build. If I select radio button "B", a small PDF is generated. (In both cases the PDF is written out to the Respon...

jQuery queue on matched set

I'm trying to trigger a sequence of effects (simple animated show/hide) on a group of images inside of div where images are tagged with classnames that provide a filtering ability thru class selectors. <div id="myDiv"> <img class="tag1 tag2 tag3" ... /> <img class="tag2 tag3" ... /> <img class="tag1 tag2" ... /> ...mor...

Multiple Queues in jQuery

I am having problems using multiple queues in jQuery. Consider the following example: $('#example').click(function() { $(this).delay(1000, 'fx2').queue('fx2', function() { alert('here'); }); }); The alert never fires. Why? ...

Pointers to structures

typedef struct queue { int q[max]; int qhead; int qrear; } queue; void init_queue(queue *QUEUE) { QUEUE.qhead = 0; QUEUE.qrear = -1; } void enqueue(queue *QUEUE,int data) { QUEUE.qrear++; QUEUE.q[QUEUE.qrear] = data; } int process_queue(queue *QUEUE) { if(QUEUE.qhead > QUEUE.qrear) return -1; else return Q...

Server side command line queuing

Is it possible to have a server side program that queues and manages processes that are executed at the command line? The project I am working on takes an image from the user, modifies the image then applies it as a texture to a 3D shape. This 3D scene is generated by blender/Cinema 4d at the command line which outputs it as an image. I...

Lipipq(iptables) . How do I redirect captured packet to another address with iptables queue?

Hi Developers, I don't know how to solve my problem. Is it possible to redirect captured packet with ipq_set_verdict()? I want to redirect unauthorized users to login page. Please see my code: The packets are accepted and my browser opens requested page(not changed destination address) void main() { struct ipq_handle* h; i...

Producer/consumer in Grails?

Hi all, I'm trying to implement a Consumer/Producer app in Grails, after several unsuccessful attempts at implementing concurrent threads. Basically I want to store all the events coming from a clients (through separate AJAX calls) in a single queue and then process such a queue in a linear way as soon as new events are added. This look...

How can I run a function anytime anything is animated with jQuery?

Hi - I have some jQuery animations in my code to slide divs up and down in response to some mouse clicks and other logic. This is all working just peachy, however in IE 6 some of the smaller icon images on the page don't slide along with the rest of the div for some strange reason. They kind of stay put then flicker into the new positio...

Processing a database queue across multiple threads - design advice

I have a SQL Server table full of orders that my program needs to "follow up" on (call a webservice to see if something has been done with them). My application is multi-threaded, and could have instances running on multiple servers. Currently, every so often (on a Threading timer), the process selects 100 rows, at random (ORDER BY NEWID...

Sending Documents to Users' Print Queues Across the Network

I have a web service (available to employees in the organization via intranet only) deployed on IIS, and its job is to create a PDF file and place it into a folder located on the network. Before they generate the PDF, the User can choose a "send to printer" option. I know it's possible to send a file directly to a printer, but we hav...

What happens when Front ==rear in circular queue

What happens when front==rear in circular queue is queue have one element or is full or is empty ...

priority queue with limited space: looking for a good algorithm

This is not a homework. I'm using a small "priority queue" (implemented as array at the moment) for storing last N items with smallest value. This is a bit slow - O(N) item insertion time. Current implementation keeps track of largest item in array and discards any items that wouldn't fit into array, but I still would like to reduce num...

.net 4.0 concurrent queue dictionary

I would like to use the new concurrent collections in .NET 4.0 to solve the following problem. The basic data structure I want to have is a producer consumer queue, there will be a single consumer and multiple producers. There are items of type A,B,C,D,E that will be added to this queue. Items of type A,B,C are added to the queue in th...

optimistic lock-free FIFO queues impl?

is there any C++ implementation (source codes) of "optmistic approach to lock-free FIFO queues" algorithm? ...

Iterating through std queue

Hi, I'm trying to use BOOST_FOREACH for iterating through the std::queue. But there isn't iterators in that class cause I have an error: std::queue<std::string> someList; BOOST_FOREACH(std::string temp, someList) { std::cout << temp; } >no matching function for call to begin(...) >no type named ‘iterator’ in ‘class std::queue<std::b...

Recycle Freed Objects

suppose I need to allocate and delete object on heap frequently (of arbitrary size), is there any performance benefit if instead of deleting those objects, I will return it back to some "pool" to be reused later? would it give benefit by reduce heap allocation/deallocation?, or it will be slower compared to memory allocator performance,...

How to specify the equivalent of ppn (on PBS) in SGE queuing system ?

Hello All, Is there a way to specify the ppn ( or equivalent ) in SGE ? i don't want to use all cpus in one node so i will be able to have more memory per core. ( In PBS you would do -l nodes=16:ppn=2 for exemple) Thanks. ...

what's wrong with my producer-consumer queue design?

I'm starting with the C# code example here. I'm trying to adapt it for a couple reasons: 1) in my scenario, all tasks will be put in the queue up-front before consumers will start, and 2) I wanted to abstract the worker into a separate class instead of having raw Thread members within the WorkerQueue class. My queue doesn't seem to disp...