Questions tagged [concurrent-queue]

Concurrent Queue is thread-safe first in - first out (FIFO) collection.

Concurrent Queue is thread-safe first in - first out (FIFO) collection/container.

Implementations

93 questions
0
votes
2 answers

ConcurrentQueue with items that have sequence value

I'm using a ConcurrentQueue to store results of a certain activity that occurs in my system (ASP.NET Core 6). It works well. But now I have a new requirement: I need a Result.Id property - a long value, similar to a sequential database…
lonix
  • 14,255
  • 23
  • 85
  • 176
0
votes
1 answer

C++ moodycamel concurrent queue - enqueue pointers

I am trying to use ConcurrentQueue to log items into a file on a separate thread: https://github.com/KjellKod/Moody-Camel-s-concurrentqueue This works: // declared on the top of the file moodycamel::ConcurrentQueue q; // logger queue . .…
Boppity Bop
  • 9,613
  • 13
  • 72
  • 151
0
votes
1 answer

Working with data held in a ConcurrentQueue

I have a background worker that streams data and saves it to a ConcurrentQueue which is what I need since it is a thread safe First In First Out collection, but I also need to do tasks like perform simple calculations or to pull data from this…
DarthVegan
  • 1,719
  • 7
  • 25
  • 42
0
votes
0 answers

Way to give queue container to each thread

My purpose is to create queue sets for send data to each thread, assign queue's address to each thread, and then freely pass data to by queue To do this, what kind of method or container I use? One of the plans I came up with was to deliver data…
lampseeker
  • 37
  • 6
0
votes
0 answers

ConcurrentQueue declare static?

I want to use a shared list (ConcurrentQueue) for my project, that includes a listener, a processor and a sender. The listener enqueues items to a list, the sender dequeues them from the same list (FIFO). The processor does some processing in…
ChrisB
  • 37
  • 3
  • 9
0
votes
1 answer

Preventing access to concurrent queue while rebuilding

I have a ConcurrentQueue which holds an object with some helpers methods to enqueue and dequeue from the queue. There is a need to remove items from the queue which match some criteria and then rebuild the queue since they might not be in the first…
Jimenemex
  • 3,104
  • 3
  • 24
  • 56
0
votes
0 answers

Can I execute Tasks with ConcurrentQueue automatically by passing task(method) as a parameter of ConcurrentQueue.Enqueue?

I want to make a queue manager which execute tasks(method) in ConcurrentQueue. The function of the queue manager is executing any tasks(methods) in queue automatically. to do this, I try to pass task(method) into queue, and try to execute that…
SW J
  • 1
0
votes
1 answer

Thread + While(true) + Entity

I'm building a candle recorder (Binance Crypto), interesting in 1 minute candles, including intra candle data for market study purpose (But eventually I could use this same code to actually be my eyes on what's happening in the market) To avoid…
0
votes
0 answers

Poor Performance BackgroundService dequeuing from Queue

I have a HostedService which inherits from BackgroundService. It loops and dequeues items from a Queue. These items are placed on the queue via a Controller from a http request. If I set Postman runner to fire an item every 500 miliseconds, for up…
fourbeatcoder
  • 1,159
  • 3
  • 13
  • 21
0
votes
1 answer

c# 1D-byte array to 2D-double array

I'm dealing with c# concurrent-queue and multi-threading in socket-programming tcp/ip First, I've already done with socket-programming itself. That means, I've already finished coding about client, server and stuffs about communication itself basic…
0
votes
0 answers

How to handle unsent messages in a concurrent queue in a web api

I am using a concurrent queue in my Web API as mentioned in thread How to maintain state or queue of requests in Web API But I am running into an issue where if the application pool is stopped or recycled it looses all the data in the memory. Can…
0
votes
1 answer

RxJS parallel queue with concurrent workers and handling of each request

I'm having trouble with RxJS and the correct way to handle an array of request. Let's say I have an array of about 50 requests as follows: let requestCounter = 0; function makeRequest(timeToDelay) { return of('Request…
0
votes
0 answers

Comparing ConcurrentQueue.Count to integer returns wrong result

I am writing usual reader-writer functionality with one main thread that equeues and several threads that dequeues. So, there is a part of the code where I am comparing count of items in my ConcurrentQueue with some integer number, let's call it…
Yngvin
  • 1
  • 1
0
votes
1 answer

Holding requests until a message is in front of ConcurrentQueue not working

I am having an issue where it looks like my ConcurrentQueue in a singleton is not processing items in the correct order. I know it's FIFO, so I am thinking that maybe the queue in memory is not the same somehow or something is going wrong with my…
Shawn
  • 2,355
  • 14
  • 48
  • 98
0
votes
1 answer

When is a ConcurrentQueue needed?

I'm asking this related to this question: Using events on multithreading socket server I´ve implemented a ConcurrentQueue thinking it would be needed to avoid problems with multi-threading. When doing it I've noticed the only difference with the…
Nanoc
  • 2,381
  • 1
  • 20
  • 35