Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [queue]

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

6
votes
0answers
93 views

Using decorated methods in a subclass of deque to dump its state to a JSON file

I am sub-classing an object in python and I need to overload a bunch of the methods with very similar logic, essentially a call to super() and then some additional operations. I want to avoid ...
4
votes
0answers
132 views

Concurrent Queue using Ada SPARK with the Ravenscar profile

See here: https://gitlab.com/linted/linted/blob/162b5e9fba53a90b3c6d78e214776e069c3c722b/src/ada-core/src/linted-queues.adb The code implements a concurrent queue. It can't allocate memory or use ...
3
votes
0answers
38 views

Templatized GLib asynchronous queue

I'm working on a legacy C++ project, which is using GLib for its Main Event Loop. This has caused a lot of ugliness because it mixes C++ and C paradigms (no C++ wrapper for GLib had been used). ...
3
votes
0answers
87 views

Lock-free Immutable ConcurrentQueue

Similar to the code review I posted last week for an agent-based immutable replacement for ConcurrentDictionary, I have also created an agent-based immutable ...
3
votes
0answers
544 views

A Thread-Safe FIFO in C99

I started a little weekend project to try and learn how to multithread with pure C99 and POSIX threads. The project is composed of three threads, input, processing, and output, which communicate with ...
3
votes
0answers
320 views

Blocking Promise-driven queues with ECMAScript's async/await and generators

I implemented an AsyncQueue, whose dequeue() operation returns a Promise. The ...
3
votes
0answers
34 views

Python simulacrum of windows copy window

I wrote a program to copy files with an progress bar that looks similar to Windows built in function. The copy function is run in a separate thread and the tkinter GUI is run in the main thread. This ...
3
votes
0answers
2k views

Checking number of messages in jms queue code

I need to check number of messages in a jms queue for that i am using queuebrowser. Actually i have 2 queues. I check if there are more then 10 messages in second queue then the first queue should not ...
3
votes
0answers
399 views

Immutable queue implementation in Scala

I created a queue in which we can perform Enqueue, Dequeue and Traversing in Scala. ...
3
votes
0answers
332 views

Queue with “unlimited” buffer in Go

This is small piece of bigger puzzle, but usable by its own. It an attempt to have a nonblocking queue with "unlimited" (besides memory size) buffer length. Got unit-tests 100% statement coverage, it ...
2
votes
0answers
67 views

thread safe queue with interrupt function

I try to implement a thread safe queue with the interrupt function (interrupt all threads who are blocking to take data from queue). ...
2
votes
0answers
74 views

Throttle submissions to ExecutorService

To prevent an XY problem, I'll first explain the problem I am trying to solve: Problem I am trying to solve I want to send the contents of a MongoDB collection with a size of around 3 million ...
2
votes
0answers
385 views

Producer Consumer Using TPL Dataflow

I have written the following class which is supposed to act as a consumer of messages that are passed in from producers and forward them onto amazon SQS, I have made a compromise by starting the ...
2
votes
0answers
238 views

Request Queue for League of Legends API

I am working on some website for League of Legends statistics, which uses the RiotGames API. The API allows you to do a maximum amount of requests per 10 seconds, and another maximum amount of ...
2
votes
0answers
83 views

Blocking Memory Queue

This is a FIFO blocking memory queue in F# to be used as a component in a logging library. ...
2
votes
0answers
45 views

Functional, Loaner-Like Pattern For Consuming SQS Queues, Deleting Queue Items On Success

My program fetches input from a RabbitMQ or Amazaon SQS-like queue. There is not always input available in the queue. If a message is available, it triggers work. If that work is successful, ...
2
votes
0answers
487 views

Multithreaded queue manager

I've written a simple multithreaded queue manager in JavaScript which will be seeing some pretty heavy usage at a later point in the project I'm working on. I think it's pretty solid, but I wouldn't ...
2
votes
0answers
510 views

WebApi synchronize database (EF 6) access

I'm working on an ASP.Net MVC 5/WebApi 2 project. I'm using EF 6 code first for my database access. I have a WebApi action method in which I've to update some data in my database based on the request....
1
vote
0answers
21 views

Puzzling SBCL Compiler Note

I’m having trouble understanding an SBCL compiler note about unreachable code in the following function. The referenced code is attempting to push a value into an Lparallel queue: ...
1
vote
0answers
76 views

Immutable Queue with Bulk-Enqueue

I recently needed a data structure with FIFO queue semantics that supported efficient bulk-insertion (often need to enqueue thousands of messages at once). I took a look at Purely Functional Data ...
1
vote
0answers
72 views

thread safe queue with watermarks

A thread-safe queue suspending/resuming the producer when respectively upper/lower watermark has been crossed. Intended usage - interchange between a non-blocking IO loop thread and a consumer running ...
1
vote
0answers
332 views

Continuous queue with delay support

I'm new to programming in Python, and I have a task to try and create continuous queue but with delay support. I need to use this for a messaging queue and simulate network latency at different rates ...
1
vote
0answers
428 views

Socket server with consumer-producer design to handle concurrent connections

The usual way is to implement socket server to handle concurrent requests by creating new thread for each request. Instead of this approach i tried to create a server using ...
1
vote
0answers
638 views

Load balancing consumer and producer with multiprocessing

Tasks are distributed to producer in multiple worker process. Results from workers are sent through Queue to a ...
1
vote
0answers
1k views

Array based Queue Implementation using Templates

This is my first code using templates and I wanted to know if the code looks good? I have some doubts like what's the best way to report error to user (queue full/empty), I checked a link online http:...
1
vote
0answers
76 views

Implementation of Dequeue data structure

I have just started learning to code for interviews and I would like to request a code review of a "Dequeue" data structure. I could not find any implementation anywhere to compare it to. I would like ...
1
vote
0answers
2k views

Deque using doubly linked list

I was trying to implement a deque using a singly LL when I realized that eject() (popping the tail element) wasn't going to work without a pointer to the previous ...
1
vote
0answers
60 views

Counting dropped frames while converting uncompressed video data

I am writing a class for converting uncompressed video data which processes data in its incoming queue and stores them in its outgoing queue. Every time it tries to process a frame of a format it ...
1
vote
0answers
213 views

Queue that permits at most X simultaneous operations

I ran into this once (permits=N) and then again today (permits =1) where I only want 1 to N operations running simultaneously. One example comes from firing into a state machine (the permit=1 example)...
1
vote
0answers
1k views

Are there pitfalls to this solution to read messages from a queue in parallel?

I've posted a question on stackoverflow: How can I consequently read messages from a queue in parallel? I would like my own answer to be reviewed. Situation We have one message queue. We would like ...
0
votes
0answers
22 views

Priority URL queue that does not block on put()

I am trying to build a priority queue that never blocks on put(), and discards the lowest priority item if it is full and user attempts to ...
0
votes
0answers
149 views

Using RabbitMQ in asp.net web api

Use case : I have a Order web Api which creates an orders and publish the order to messaging queue. Notification service (web api 2) consumes this message by subscribing to the messaging queue and ...