Questions tagged [queue]

A queue is an ordered, first-in-first-out data structure. Typical implementations of queues support pushing elements to the back and popping them off the front position.

  • A queue is not limited to a fixed capacity
    • A bounded queue is a queue limited to a fixed number of items
  • A doubly linked list is a good implementation choice

Operations

  • enqueue - pushes an element to the end of the queue
  • dequeue - pops an element from the front of the queue

See Also

Resources

Queue Wikipedia Article

11098 questions
3
votes
1 answer

Does performSelectorInBackground spawn new thread for each call?

Does performSelectorInBackground spawn a new thread for each call or does it share a thread (which is not main thread) for all calls (maybe queued)?
eugene
  • 39,839
  • 68
  • 255
  • 489
3
votes
1 answer

Read value from one thread in Python: queue or global variable?

I have a thread which every 10ms measures an voltage value (captured from an external device), applies some elementary low-pass filtering and stores the value in a variable lp_voltage. Every few seconds the main program needs to read the value…
Daniel Arteaga
  • 467
  • 3
  • 9
3
votes
4 answers

Setting queueSize option on SEDA

I have a seda queue where i set queueSize option according to the camel documentation The route i have looks like: from("seda:someQueue?concurrentConsumers=10&queueSize=10") .process(someProcessor); I'm getting the following error due to the…
lai yoke hman
  • 261
  • 4
  • 12
3
votes
2 answers

laravel queue jobs for logging to DB?

I log some of the api requests. It is currently done sync and I would like to process this DB call async to allow faster response times for the actual api call. The way to do this in Laravel seems to be the queue/job system. However I am not sure…
Chris
  • 13,100
  • 23
  • 79
  • 162
3
votes
0 answers

Laravel Mail Queue Not Working

I am using queue function of laravel to send email. But I think it is not working because it slow down the page process when sending large emails and do data is being saved in jobs table. I am using following…
Developer5
  • 51
  • 5
3
votes
1 answer

The remote server returned an error: (400) Bad Request when trying execute AddMessageAsync()

I am facing a problem with Azure Web job while trying to insert a message in Webjob from another project. Not much help found in github issues. confused about what is wrong. my code is as follows: var queueClient =…
3
votes
2 answers

Priority Queue poll() time complexity

Given the code below: pq.offer(x); pq.poll(); For the first line code, element x is inserted into Priority Queue pq, the time complexity of the offer is log(k), where k is the size of pq. Then my question is, for the second line code that…
LookIntoEast
  • 8,048
  • 18
  • 64
  • 92
3
votes
2 answers

AWS SQS standard queue or FIFO queue when message can not be duplicated?

We plan to use AWS SQS service to queue events created from web service and then use several workers to process those events. One event can only be processed one time. According to AWS SQS document, AWS SQS standard queue can "occasionally" produce…
Raymond
  • 115
  • 2
  • 11
3
votes
1 answer

Azure alerting rule for poison queue count

In a pervious project I have managed to setup a Alert rule that looks at poison queue message count and alerts using a webhook into slack when something is in the queue (once per day). I was trying to find where this exists in Azure as it looks like…
Faesel Saeed
  • 199
  • 1
  • 15
3
votes
2 answers

Cut and Stack the Array

I have an array of int as input. The array will always be a length of 2^n. I want to cut the array in half and stack it. Repeat cutting and stacking until there is only one stack. For example: int[] array = {1,2,3,4,5,6,7,8} if we cut the array in…
OLIVER.KOO
  • 5,654
  • 3
  • 30
  • 62
3
votes
1 answer

Python multiprocessing Deadlock using Queue

I have a python program like below. from multiprocessing import Lock, Process, Queue, current_process import time lock = Lock() def do_job(tasks_to_accomplish, tasks_that_are_done): while not tasks_to_accomplish.empty(): task =…
Pankaj
  • 5,132
  • 3
  • 28
  • 37
3
votes
2 answers

REVISED WITH COMMENTS v1: Multiprocessing on same dict/list

I am fairly new to python, kindly excuse me for insufficient information if any. As a part of the curriculum , I got introduced to python for quants/finance, I am studying multiprocessing and trying to understand this better. I tried modifying the…
3
votes
1 answer

Java: detecting "gridlock" in implicit queues during breakpoint debugging

I have a Java app that processes a datastream from data arriving via a serial port, and it displays a summary in a Swing UI. It works fine, but when I set breakpoints in Eclipse in certain threads (e.g. the Swing event dispatch thread), I have a…
Jason S
  • 184,598
  • 164
  • 608
  • 970
3
votes
1 answer

Queues dequeue enqueue error for input stream

I am trying to work with data structure of queue which is kind of circular queue. #include #include enum boolean{ false,true }; struct ArrayQueue{ int rare,front; int capacity; int *array; }; struct ArrayQueue*…
Devjeet Mandal
  • 345
  • 1
  • 4
  • 23
3
votes
2 answers

Is the RabbitMQ RPC a kind of "Work queue" with response?

is the RabbitMQ RPC a kind of Work queue with response? In the RPC description you can read: If the RPC server is too slow, you can scale up by just running another one. Try running a second rpc_server.py in a new console. So in my mind RPC is a…
DOUBL3P
  • 271
  • 3
  • 16
1 2 3
99
100