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
0 answers

How to exit out of a Concurrent Queue

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 adding Boolean operators to test whether the…
1ben99
  • 557
  • 1
  • 7
  • 14
0
votes
2 answers

No crash when mutating an array from two different threads using global concurrent queues

In the below code we have a mutable array, which is being mutated by two concurrent queues. Since concurrent queues are not thread safe, this code should ideally crash but this gets executed without any exception or crash. Kindly help me in…
Say2Manuj
  • 709
  • 10
  • 20
0
votes
1 answer

How to trigger a background thread when my queue has something to process

I am using ConcurrentQueue to store messages from multiple threads. How to create some background thread which will automatically get triggered when my queue has something in it?
Pavan Tiwari
  • 3,077
  • 3
  • 31
  • 71
0
votes
0 answers

Queueing and Dequeueing multiple types

I have an Event that is triggered by a COM Server up to many thousands times per seconds, it provides realtime price information from exchanges. In my code I can access this Event (C#): private static void COMDataStream_Price(int SymbolNr, float…
flo
  • 559
  • 1
  • 8
  • 26
0
votes
1 answer

Multiple class instances raising same event

I'm having trouble figuring out what is wrong with my C# code. I'm trying to learn how to use ConcurrentQueue class in System.Collections.Concurrent namespace. In order to do this, I'm creating 2 instances of the same class in different threads,…
TEDSON
  • 191
  • 2
  • 13
0
votes
2 answers

Concurrent vs Serial Queue for executing large number of Server requests in iOS

If an iOS app has to make hundreds of server requests in background and save the result in local mobile database, which approach would be better in terms of performance (less crashes)? Passing all requests as 1 block in Global Background…
0
votes
1 answer

How to use: System.Collections.Concurrent

I am trying to add using System.Collections.Concurrent and it is not working. The type or namespace name 'Concurrent' does not exist in the namespace 'System.Collections' (are you missing an assembly reference?)
meme
  • 597
  • 1
  • 10
  • 23
0
votes
2 answers

How to make a ConcurrentQueue to be cleaned by the condition

How to make a ConcurrentQueue to be cleaned by the condition for the first elements? Eg to clear older blog posts. I came up with this idea of a ConditionConcurrentQueue: using System; using System.Collections.Generic; using…
FreeClimb
  • 696
  • 8
  • 13
0
votes
0 answers

Convert concurrentqueue of class objects to observablecollection of same object

I have a concurrentqueue which contains class objects, I want to take those objects and put them into a observable collection of the same class object. (basically copying/moving it from the concurrentqueue to the collection.) Here I add the…
0
votes
1 answer

concurrent_queue gives same value on each thread for try_pop()

I wonder if I got it all wrong when I have tried to used concurrent_queue. I am trying to process files using threads. The Threads pickup file names from a concurrent_queue and proceed ahead. My problem is that each thread seems to process the same…
Wajih
  • 793
  • 3
  • 14
  • 31
0
votes
0 answers

Implementing multiple instances of a concurrent queue

I'm trying to work with .NET ConcurrentQueue but I'm having some trouble. This is the situation I'm trying to accomplish. When my application loads I will load a Queue with 1000 objects. When the user clicks a button it will take the first object…
AspUser7724
  • 109
  • 2
  • 10
0
votes
1 answer

Inserting multiple rows from ConcurrentQueue into SQL Server table

I have a c# application that is taking data from one database, making the necessary transformations, and inserting the data into a table in another database. I am doing this by inserting my source data into a queue and then processing the queue to…
clintperry
  • 182
  • 1
  • 8
0
votes
1 answer

Should I use a ConcurrentQueue this way or individual threads

I'm doing what amounts to a glorified mail merge and then file conversion to PDF... Based on .Net 4.5 I see a couple ways I can do the threading. The one using a thread safe queue seems interesting (Plan A), but I can see a potential problem. What…
Miguelito
  • 302
  • 3
  • 11
0
votes
2 answers

Using a Concurrent Queue to pass objects between two components of my applciation

I have a program of mine which makes use of the c# concurrent Queue to pass data from my one component to the other. Component 1: Multiple network connections receive data and then put it into this Queue Component 2: Reads data from this queue…
Zapnologica
  • 22,170
  • 44
  • 158
  • 253
0
votes
1 answer

What is a design pattern for asynchronous work that may produce more work?

I have been trying to elegantly handle the case where an asynchronous worker thread produces both a result and (possibly) identifies more work that needs to be done. To think of it another way, if you are traversing a tree and doing work at each…