Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
63 views

I am exposing an api method which accepts the request from client app. this request will be sent to another COM library where it will be validated . Based on the request data the validation may delay ...
Dosti's user avatar
  • 171
1 vote
2 answers
231 views

I'm using a ConcurrentQueue<T>. I need: multiple consumers to enqueue items a single consumer to dequeue all items in one go during the dequeue, to lock the queue so other consumers cannot ...
lonix's user avatar
  • 22.4k
0 votes
1 answer
118 views

Before I start, I'll let you know that I'm still just learning (by doing) threading, and I think I'm missing some essential piece of the puzzle. However, I am having a weird issue. The app I'm writing ...
Dion's user avatar
  • 31
2 votes
1 answer
63 views

Goal Implement a MPSC-like queue with mutexes and sempahores. Issue Eventually, the consumer will attempt to dequeue an empty queue. Minimal Reproducible Example I have edited the question to include ...
Kungfunk's user avatar
  • 115
1 vote
0 answers
82 views

Issue I am getting inconsistent behavior with message loss while attempting to use a MPMC lock-less queue (concurrentqueue) in the implementation of a mutual exclusion algorithm. In particular, I have ...
Kungfunk's user avatar
  • 115
0 votes
0 answers
45 views

Working through a textbook which suggests the following implementation for a concurrent queue. I am wondering why the two if statements, which are highlighted in the code, are necessary. After the ...
Thornsider3's user avatar
27 votes
1 answer
11k views

I recently built a consumer/producer system using ConcurrentQueue<T> and SemaphoreSlim. Then made another alternative system utilizing the new System.Threading.Channel class. After benchmarking ...
CryShana's user avatar
  • 1,323
0 votes
1 answer
206 views

I am trying to implement a concurrent non-blocking queue where the tag is in the 16 most significant bits of the pointer. It follows this algorithm here: http://www.cs.rochester.edu/research/...
callum arul's user avatar
0 votes
2 answers
1k views

My application receives data I'm trying to write to a file in a separate thread (writing it in the thread that received it directly caused performance problems). It seems ConcurrentQueue is suitable ...
bLAZ's user avatar
  • 1,767
0 votes
1 answer
133 views

I have some code that used to work for many years and even now in specific cases it works but in other cases I just cannot understand why it fails. The following code is part of a Client class that ...
Oliver's user avatar
  • 1
2 votes
3 answers
1k views

Both collections, Queue and ConcurrentQueue have a method TryDequeue. What is the difference between using TryDequeue with Queue and ConcurrentQueue respectively? Is Queue's TryDequeue method thread-...
user1080381's user avatar
  • 1,806
-2 votes
2 answers
936 views

Hi I have a concurrent Queue that is loaded with files from database. These files are to be processed by parallel Tasks that will dequeue the files. However I run into issues where after some time, I ...
Datboydozy's user avatar
0 votes
1 answer
192 views

I've got a ConcurrentQueue<Vector3[]> that I'm filling up and I want to read out of it in chunks for the sake of performance. private ConcurrentQueue<Vector3[]> positionsQueue = new ...
Shrimp's user avatar
  • 642
0 votes
2 answers
1k views

I'm using a ConcurrentQueue<Result> 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 ...
lonix's user avatar
  • 22.4k
3 votes
4 answers
3k views

I was asked to implement a thread safe dictionary in swift, I used the common approach: class MutableDictionary { var dictionary: [String : Any] = [:] var queue = DispatchQueue(label: "...
RobotX's user avatar
  • 246
0 votes
1 answer
2k views

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::...
Boppity Bop's user avatar
  • 10.6k
1 vote
1 answer
820 views

I have a background worker that streams data and saves it to a ConcurrentQueue<T> which is what I need since it is a thread safe First In First Out collection, but I also need to do tasks like ...
DarthVegan's user avatar
  • 1,269
6 votes
2 answers
2k views

Could anyone help me to understand this code I created: let cq = DispatchQueue(label: "downloadQueue", attributes: .concurrent) cq.sync { for i in 0..<10 { sleep(2) print(i) } } ...
RobotX's user avatar
  • 246
1 vote
2 answers
1k views

I have one thread responsible for enqueuing and one thread responsible for dequeuing. However, the frequency of the data being enqueued far surpasses the time needed to dequeue + process the data. ...
bjalexmdd's user avatar
  • 186
1 vote
0 answers
209 views

I want to process a Request.Body in a background-service in ASP.Net Core, so I first add it to a ConcurrentQueue. public class BackgroundJobs { public ConcurrentQueue<Stream> Queue { get; ...
ChsharpNewbie's user avatar
4 votes
1 answer
675 views

In the ConcurrentQeueue<> class, and extra method TryDequeue() is defined. But, as it implements IProducerConsumerCollection<>, it also has a TryTake() method. According to the docs, they ...
Bart Friederichs's user avatar
0 votes
0 answers
43 views

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 ...
lampseeker's user avatar
1 vote
0 answers
439 views

I am storing some messages in a concurrent queue and I need to show these messages after some delay. So I need an event that gets triggered after an item is added to the queue.
Laxmi's user avatar
  • 93
0 votes
0 answers
275 views

I want to use a shared list (ConcurrentQueue<T>) 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 ...
ChrisB's user avatar
  • 35
0 votes
1 answer
206 views

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 ...
Jimenemex's user avatar
  • 3,186
0 votes
0 answers
937 views

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(...
SW J's user avatar
  • 1
0 votes
1 answer
175 views

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 ...
Rafael Rizolli's user avatar
1 vote
1 answer
267 views

I have declared a ConcurrentQueue and added a list of GUIDs. Adding into the queue is fine, but when I access the queue from inside the TimerTrigger function it seems like it's empty (updateQueue....
tt0206's user avatar
  • 847
0 votes
0 answers
776 views

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 ...
fourbeatcoder's user avatar
0 votes
1 answer
198 views

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, ...
손창범's user avatar
0 votes
0 answers
454 views

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 ...
LeoCoder123's user avatar
1 vote
1 answer
541 views

I need to process data from a producer in FIFO fashion with the ability to abort processing if the same producer produces a new bit of data. So I implemented an abortable FIFO queue based on Stephen ...
Stephan Steiner's user avatar
5 votes
2 answers
7k views

Got a quick question. Do I have to use a concurrent queue if one thread is enqueuing and other is dequeuing? Is there any race condition/other risk when using regular container in this scenario (1 ...
Shrimp's user avatar
  • 642
5 votes
3 answers
4k views

I have multiple threads generating items and sticking them in a common ConcurrentQueue: private ConcurrentQueue<GeneratedItem> queuedItems = new ConcurrentQueue<GeneratedItem>(); private ...
Jason C's user avatar
  • 40.6k
5 votes
1 answer
1k views

Javadoc for ConcurrentLinkedQueue explicitly states that the complexity of the size() method is O(n). I find this surprising. I would follow the stock LinkedList.size() approach by accumulating the ...
Igor Urisman's user avatar
0 votes
1 answer
1k views

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) { ...
SardineBoy's user avatar
3 votes
0 answers
6k views

I am looking for a way to : read messages from a ConcurrentQueue limited to some size. read not more then X message at a time frame. I want to stop the reading from Q once one of the 2 hit, until ...
developer learn999's user avatar
0 votes
0 answers
395 views

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 ...
Yngvin's user avatar
  • 1
4 votes
2 answers
2k views

I am using ConcurrentQueue (C#, ASP.NET Core) for holding tasks for the upload of the big files. I have a very big memory consumption even after items are dequeued from the concurrent queue. Items are ...
Vedran's user avatar
  • 163
4 votes
1 answer
878 views

I have one producer and multiple consumers. I am using ConcurrentQueue. I am using C# but I think my problem is language agnostics. There can be non-unique consumers. i.e. more than one consumers can ...
Ashish Negi's user avatar
  • 5,321
4 votes
2 answers
2k views

Let's say I want to I download 10,000 files. I can easily build a queue of those 10,000 files (happy to take advice if any of this can be done better), import request from 'request-promise-native'; ...
Evan Carroll's user avatar
1 vote
3 answers
3k views

I have orders coming in from multiple threads and I want to process this data in one thread. If I understood it right, the way to do it is with ConcurrentQueue. I had a look at SO question How to ...
RWC's user avatar
  • 5,082
0 votes
1 answer
982 views

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 ...
Shawn's user avatar
  • 2,455
2 votes
0 answers
383 views

I have written an application for my company that essentially sends records from a text or CSV file in arrays of 100 records to a web service, to which it then returns the response, also in arrays of ...
M. Vahdat's user avatar
2 votes
1 answer
125 views

I am trying to understanding the concurrent queue of iOS GCD. The I made some code to test it, but found something weird. code as below: _syncQueue = dispatch_get_global_queue(...
onTheWay's user avatar
  • 128
2 votes
1 answer
2k views

I am looking for an equivalent of the concurrent_queue from Intel's tbb module in Rust. I have found some crates: multiqueue two-lock-queue crossbeam-deque and even futures-pool thread-pool I feel ...
asdetrefle's user avatar
2 votes
1 answer
564 views

I have a ConcurrentLinkedQueue and I want to split it into two halves and let two separate threads handle each. I have tried using Spliterator but I do not understand how to get the partitioned queues....
a_fan's user avatar
  • 387
0 votes
1 answer
2k views

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 ...
Nanoc's user avatar
  • 2,381
3 votes
2 answers
3k views

In my program I need two tasks to run simultaneously in the background. To do that i have used concurrent queues as below, let concurrentQueue = DispatchQueue(label: "concurrentQueue", qos: .utility,...
Hanushka Suren's user avatar
0 votes
0 answers
144 views

So I have this code that I have written which checks all proxies in my ConcurrentQueue list, but I was wondering what if I just wanted to check if 1 proxy worked and then exit out of it? So I tried ...
1ben99's user avatar
  • 557