Skip to main content

Stack Exchange Network

Stack Exchange network consists of 183 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.

Filter by
Sorted by
Tagged with
8 votes
1 answer
594 views

Shared-Memory Queue Implementation in C

Recently I am working on implementing a shared-memory based IPC message queue in C programming language on Linux system. A few design choices I've made include The queue will have only 1 producer, ...
Yukun Jiang's user avatar
1 vote
2 answers
155 views

ProducerConsumerSimulation.java: practicing concurrent programming in Java

Intro This time, I was in the mood for concurrent programing (ProducerConsumerSimulation.java). To this end, I have ended up with the code below. My primary concerns are: Class design is trash, The ...
coderodde's user avatar
  • 31.9k
4 votes
1 answer
315 views

Single-producer single-consumer queue

...
SUJEET BORAN's user avatar
8 votes
2 answers
318 views

Multi-producer, multi-consumer blocking queue

Introduction This is a queue that allows many producers to simultaneously write their items and many consumers to simultaneously read theirs. It's useful when construction and/or consumption could be ...
Toby Speight's user avatar
  • 88.2k
5 votes
3 answers
624 views

C++ std::function-like queue

I aim to create a call queue to schedule work for another thread. I'm using a virtual base class for type erasure and placement new for reducing the number of allocations, but, as far as I know, ...
user avatar
6 votes
3 answers
709 views

Ring Buffer Implementation in C++

The following code is designed for handling real-time messages. It assumes there will be only two threads using the RingBuffer object: A provider thread calls the <...
Gabriella Chaos's user avatar
3 votes
1 answer
83 views

A Simple BlockingQueue implementation in C++

I'm just dusting off my C++ knowledge in area of multithreading. I started with implementing a producer-consumer pattern inspired by https://jenkov.com/tutorials/java-util-concurrent/blockingqueue....
Matt Black's user avatar
3 votes
1 answer
69 views

A generic queue that transfers data from interrupt to main program

This code aims to implement a queue, which transfers data from interrupt to main program in a bare metal embedded system. There are two execution points, the main program and the irq handler. Both ...
Jackoo's user avatar
  • 131
9 votes
2 answers
641 views

Advent of code 2023 day 5 in Java: mapping integer ranges to new integer ranges

Context I'll be passing an interview coding test in java soon. I am experienced with other programming languages but am very unfamiliar with Java. I am looking for critiques of the coding style much ...
Stef's user avatar
  • 322
-1 votes
1 answer
85 views

Queue implementation in C# [closed]

I have tried to implement a queue from scratch, and it doesn't really seem to match what i found on internet, and I am wondering if this is a correct implementation, and what makes using Stack ...
Imane's user avatar
  • 11
6 votes
3 answers
655 views

Redefining queue with different front and rear

...
Sai_krishna's user avatar
3 votes
2 answers
91 views

Enhancing a non-multithreaded Circular buffer

Looking to get some feedback on a simple non-multithreaded circular buffer. Ideally, I'd want to have a logic to prevent the data from getting overwritten but couldn't find a reasonable way. For ...
xyf's user avatar
  • 508
6 votes
1 answer
514 views

Synchonizing queue with mutex

I am trying to syncronize the queue between threads using mutex. I have 2 mil random integers in input.txt file. Main thread reads integers then puts them in queue. Other threads are simultaneously ...
EternalLlama's user avatar
1 vote
1 answer
125 views

Queue-mergesort: a mergesort that does optimal number of comparisons in the worst case in Java

Here is the code for queue-mergesort by Mordecai J. Golin and Robert Sedgewick: com.github.coderodde.util.QueueMergesort.java: ...
coderodde's user avatar
  • 31.9k
4 votes
1 answer
307 views

Blocking Queue Class Unit Test

I would like any feedback on making the unit test for a BlockingQueue class more robust or better? improvements to the coding style, use of the ...
Simon's user avatar
  • 209

15 30 50 per page
1
2 3 4 5
27
Morty Proxy This is a proxified and sanitized view of the page, visit original site.