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.

33 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
184 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 ...
Molly Stewart-Gallus's user avatar
4 votes
0 answers
448 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 ...
canni's user avatar
  • 211
3 votes
0 answers
595 views

Async FIFO processing of database writes - naive implementation in .Net 6

One of the companies I was recently interviewing with gave me a following task to implement in a day or two using .Net, just to see where my coding abilities are at: Implement a Web API that gets ...
mi105's user avatar
  • 31
3 votes
0 answers
2k views

File-system based queue in python

I would like to implement a concurrent (multi-thread, multi-process) queue that is backed by file system. Data is pickled over a file, stored in a directory and given a sequential name. The ...
The Data Scientician's user avatar
3 votes
0 answers
203 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). ...
Wizard79's user avatar
  • 141
3 votes
0 answers
623 views

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

I implemented an AsyncQueue, whose dequeue() operation returns a Promise. The ...
ComFreek's user avatar
  • 751
3 votes
0 answers
59 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 ...
jakethemc's user avatar
3 votes
0 answers
3k 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 ...
kirti's user avatar
  • 163
3 votes
0 answers
525 views

Immutable queue implementation in Scala

I created a queue in which we can perform Enqueue, Dequeue and Traversing in Scala. ...
Prabhat Kashyap's user avatar
3 votes
0 answers
554 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 ...
Elliot Bonneville's user avatar
2 votes
0 answers
753 views

Multi-producer/single-consumer queue in Python

I am currently working on a problem that involves multiple producers and a single consumer through a queue object. The following list is about a few things that's special about this problem: One ...
dhu's user avatar
  • 327
2 votes
0 answers
250 views

Fixed-width non-FIFO DispatchQueue

I have implemented a custom concurrent queue on top of GCD which offers two additional pieces of functionality: Limit the maximum number of concurrently executing tasks. Give manual control over ...
Marcel Tesch's user avatar
2 votes
0 answers
719 views

MongoQ - A Task queue system using Mongo

I've been using Beanstaldk (not Amazon's one) for years and loved the possibility to handle delays and priorities in the tasks, but I recently had to filters the tasks for specific reasons, and ...
Cyril N.'s user avatar
  • 245
2 votes
0 answers
87 views

Lock-free pooled queue

I am attempting to create a lock free pool of resources and I need the ability to access any one that is not already accessed and then return it back when I do not need it. This will happen very very ...
Christopher Silvas's user avatar
2 votes
0 answers
507 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). ...
szh's user avatar
  • 21
2 votes
0 answers
266 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 ...
Stefan van den Akker's user avatar
2 votes
0 answers
577 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 ...
xerxes's user avatar
  • 327
2 votes
0 answers
276 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 ...
Danmoreng's user avatar
  • 121
2 votes
0 answers
94 views

Blocking Memory Queue

This is a FIFO blocking memory queue in F# to be used as a component in a logging library. ...
Lord Terabyte's user avatar
2 votes
0 answers
52 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, ...
FullTimeCoderPartTimeSysAdmin's user avatar
2 votes
0 answers
517 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....
user1320170's user avatar
1 vote
0 answers
2k views

Node.js batch processing

Batch processing steps: When a job is posted, push it to the queue. Get the required number of items from the queue and put it in the ...
sg7610's user avatar
  • 370
1 vote
0 answers
56 views

Implementing a Queue with Small size optimization

I was trying to implement a queue implementing the small size optimization. I was wondering any ways I can make this code better (more performant, better code style, etc). It seems to work fine (in ...
Mihir Shah's user avatar
1 vote
0 answers
48 views

Run non overlapped periodical tasks on user specified executor

I have concurrency tasks in my module: user code is able to instantiate my object and specify Executor service, then user can submit requests to this object which ...
g4s8's user avatar
  • 111
1 vote
0 answers
40 views

regex on a log file utilizing stacks and queue's in Java

This would be for a MUD client, which has elements of a sort of telnet bot. Here, there's ...
Thufir's user avatar
  • 379
1 vote
0 answers
192 views

Codewars Kata - Tickets Queue

The challenge: You managed to send your friend to queue for tickets in your stead, but there is a catch: he will get there only if you tell him how much that is going to take. And everybody can ...
jpolache's user avatar
  • 127
1 vote
0 answers
71 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: ...
davypough's user avatar
  • 415
1 vote
0 answers
735 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 ...
Bryan Davis's user avatar
1 vote
0 answers
918 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 ...
benjamin c's user avatar
1 vote
0 answers
1k 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 ...
hamster on wheels's user avatar
1 vote
0 answers
2k 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:...
zorro's user avatar
  • 61
0 votes
0 answers
96 views

Simulation: Find a waiting queue order that minimizes the total waiting time - Java

Intro Suppose we are given a queue of waiting times \$\langle t_1, \ldots, t_n\rangle\$. The first "person" \$(t_1)\$ leaves the queue immediately. The persons \$(t_i), i > 1\$ all have ...
coderodde's user avatar
  • 27.6k
0 votes
0 answers
332 views

ASP.NET Core 6 background DB logger

In an application, many actions need to be logged in the database. but this logging process should not slow down the request. So they should be done in an asynchronous queue or something. This is my ...
Parsa99's user avatar