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
1
vote
2 answers

File writing from multiple threads.

I have an application A which calls another application B which does some calculation and writes to a file File.txt A invokes multiple instances of B through multiple threads and each instances tries to write to same file File.txt Here comes the…
rahulmr
  • 681
  • 1
  • 7
  • 19
1
vote
1 answer

VB.Net: Retrieving items from a ConcurrentQueue on a thread

I've got a class running on one thread which listens for data and pushes it into a ConcurrentQueue of strings. I'm adding data to it using Enqueue and I can see that the queue length is growing so I know that data is being queue correctly. Another…
Philip Lee
  • 157
  • 3
  • 16
1
vote
1 answer

Reading and writing from queue

I'm saving a set of ~300 bitmaps in a concurrent queue. I'm doing this for an over-tcp video streaming program. If the server slows down I save the received bitmaps in this queue (buffering). I created a separate project to test this but I'm having…
sergiu reznicencu
  • 1,039
  • 1
  • 11
  • 31
1
vote
3 answers

How to sort TBB concurrent_vector or concurrent_queue?

Now I have a solver in that I need to keep a set of self-defined data type objects in a concurrent_vector or queue. It has to be concurrent because the objects come from different threads.With this concurrent container, I hope to sort these objects,…
Jackie
  • 1,071
  • 2
  • 12
  • 17
1
vote
1 answer

What may be strategy when Queue of task execution very big?

I have ConcurrentQueue TasksCollection wich contains ITask objects. It is not Task class of .Net framework. public class TaskRunner:IDisposable { private Task _orderTask; public TaskRunner() { TasksCollection = new…
Admiral Land
  • 2,304
  • 7
  • 43
  • 81
1
vote
2 answers

How to update WPF UI Thread concurrently?

I have scanario where I am reading data from disk in multi threaded way using TPL. I have WPF GUI as processes's main thread which is displaying data read from these threads. How can I update data on WPF GUI with real time as they processed? How…
Usman
  • 2,742
  • 4
  • 44
  • 82
1
vote
1 answer

System.Threading.dll makes WPF application start in more than 30 seconds

A "completely empty" WPF application project targetting framework 3.5 takes more than 30 seconds to start on Windows 7 embedded SP1. The problem doesn't appear on Windows 7 Enterprise SP1 neither on Windows XP. The only thing in the WPF project is a…
nkoniishvt
  • 2,442
  • 1
  • 14
  • 29
1
vote
2 answers

Using Blocking Collection for Database Access and Downloading Images in c#

I am working on a program where there are two buttons on the form. First one performs function of accessing the database while other downloads image from database and saves it along with 3 copies of image (Thumbnail, zoom, small). Code for…
LearningAsIGo
  • 1,240
  • 2
  • 11
  • 23
1
vote
2 answers

BackgroundWorker and ConcurrentQueue

I have a FileSystemWatcher which is looking for new files, putting the filenames in a Queue. In a seperate Thread the Queue is worked off. My code is working, but I question if there could be information lost, because of the asynchronous process.…
JDeuker
  • 896
  • 1
  • 11
  • 17
1
vote
0 answers

What is the best way to do a parallel Breadth First Search in C#?

As the title says, I'm looking for the best way to do a parallel BFS in C#. I want it to be as fast as possible and use as little memory as possible. If there is no 'best' way, what are good options? I want to use this for solving a puzzle (in my…
1
vote
1 answer

concurrentQueue tryDequeue with unknown out result

I'm trying to build a flexible method to handle different kind of ConcurrentQueues, 'cause most logic to handle the queue's is the same. It looks a bit like this: private void StartDoWorkButton(object sender, EventArgs e) { …
user369122
  • 792
  • 3
  • 13
  • 33
0
votes
1 answer

When should System.Threading.Channels be preferred to ConcurrentQueue?

I recently built a consumer/producer system using ConcurrentQueue and SemaphoreSlim. Then made another alternative system utilizing the new System.Threading.Channel class. After benchmarking both systems using BenchmarkDotNet by writing 1000…
0
votes
1 answer

Using most significant bits of pointers as a tag in non-blocking queue c++

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/synchronization/pseudocode/queues.html However, this…
0
votes
1 answer

ConcurrentQueue.Count remains zero when socket receive adds data

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 uses a System.Net.Sockets.Socket for…
Oliver
  • 1
  • 2
0
votes
1 answer

Convert a C# collection of arrays to a single array efficiently

I've got a ConcurrentQueue that I'm filling up and I want to read out of it in chunks for the sake of performance. private ConcurrentQueue positionsQueue = new ConcurrentQueue(); For example I want to wait until…
Shrimp
  • 514
  • 5
  • 9