Questions tagged [blockingcollection]

A .Net class that provides blocking and bounding capabilities for thread-safe collections.

A .Net class that provides blocking and bounding capabilities for thread-safe collections.

References

233 questions
-1
votes
1 answer

.Net BlockingCollection not work with Parallel.foreach

I have tried to feed a dictionary with the values of a BlockingCollection (...) lock (blockingCol) { lock (cache) { cache = new Dictionary(); Parallel.ForEach(blockingCol, (document) => …
-1
votes
1 answer

How to concurrently take items from the BlockingCollection?

I have a BlockingCollection of integers. Below is the code I am trying to develop to remove the items concurrently from the BlockingCollection. static void Produce() { for (int i = 0; i < 100000; i++) { bc3.Add(i); …
tRuEsAtM
  • 3,517
  • 6
  • 43
  • 83
-1
votes
1 answer

BlockingCollection Out of Memory Exception

I have a program in which i am getting bitmap images from Camera loading them in blocking collection and processing in a thread. I am calling SetImage from UI thread. It works for few seconds then i run into out of memory exception. Please…
Zshan
  • 26
  • 5
-1
votes
1 answer

Blocking collections + Multiple Worker threads per blocking collection + Wait For Work Completion

I have to do action in batch of 1000 message say Action A, B, C. I can do these actions in parallel. I created groups for them. To increase parallelism, I created subgroups with in each group. Task with in a subgroup needs to be executed serially.…
Rajesh Gaur
  • 287
  • 5
  • 11
-1
votes
1 answer

Should BlockingCollection.TryTake(object,TimeSpan) return immediately on new data?

I am trying to ascertain why performance on my blocking collection appears slow. A simple version of my code is illustrated in the question further below. My question here is if BlockingCollection.TryTake(object,TimeSpan) returns immediately on new…
ManInMoon
  • 6,795
  • 15
  • 70
  • 133
-1
votes
1 answer

Pass multiple parameters to a task

I wish to pass two BlockingCollection<>s to a task. I tried to put them in an object array and pass them but it doesn't work. Can anyone help me with this? The code where i am trying to pass the values is written below: var lineHolders = new[] { …
displayName
  • 13,888
  • 8
  • 60
  • 75
-3
votes
1 answer

Blocking Collection shows Duplicate entries

I first retrieve Total number of rows in my table (say 100) and then divide them into chunks (say 25). Then I create a task (taskFetch) which fetches rows from MyTable in chunks into DataTable (each containing 25 records) using Parallel.Foreach()…
Sadiq
  • 786
  • 1
  • 10
  • 35
-3
votes
1 answer

Inserting user actions to database asynchronously, not producing a lot of thread C#

I'm trying to build this analytical system, this pushes data to the database on specific actions user performs. There will be multiple actions which will need to be logged, hence this needs to be asynchrously done, but it can't spawn off many…
user1393503
  • 275
  • 1
  • 4
  • 10
1 2 3
15
16