Questions tagged [bufferblock]

10 questions
6
votes
0 answers

OpenGL 4.5 - Shader storage buffer objects layout

I'm trying my hand at shader storage buffer objects (aka Buffer Blocks) and there are a couple of things I don't fully grasp. What I'm trying to do is to store the (simplified) data of an indeterminate number of lights n in them, so my shader can…
Carlos Romero
  • 698
  • 8
  • 18
2
votes
1 answer

TPL Unit Test BufferBlock LinkTo TargetBlock

I am trying to create unit tests for a TPL BufferBlock and want to test that an exception gets thrown. However, the test passes before the exception gets thrown. EDIT Also, this is a long running process so I do not call complete. This process runs…
GamerDev
  • 2,006
  • 4
  • 24
  • 31
2
votes
1 answer

Are items removed from BufferBlock when ActionBlock starts or ends?

Let's say I have a BufferBlock with a bounded capacity of 2 and I link it (using LinkTo()) an ActionBlock with MaxDegreeOfParallelism = 2. Now, I know that I will immediately be able to send 2 items to the buffer and the ActionBlock will begin…
PICyourBrain
  • 9,976
  • 26
  • 91
  • 136
1
vote
0 answers

BoundedChannel, BufferBlock or something else?

I have a problem where I have allot of data coming into a system, as it comes in it gets stored on the disk and then goes though a pipeline where it is transformed. Each step in the pipeline may be CPU bound or not, but my overall problem becomes…
Jens
  • 3,353
  • 1
  • 23
  • 27
1
vote
0 answers

TPL Dataflow two-phase commit

I wanted to implement something like two-phase commit protocol for consuming messages. In order to do it, I implemented ITargetBlock myself: public class Worker : ITargetBlock { // Is connected to remote server // Maintaining…
Veikedo
  • 1,453
  • 1
  • 18
  • 25
1
vote
1 answer

TPL BufferBlock Consume Method Not Being Called

I want to implement the consumer/producer pattern using the BufferBlock that runs continuously similar to the question here and the code here. I tried to use an ActionBlock like the OP, but if the bufferblock is full and new messages are in it's…
GamerDev
  • 2,006
  • 4
  • 24
  • 31
0
votes
0 answers

Using BufferBlock as Observable without consuming the elements

We use BufferBlocks to build a small simulation tool where we want to find areas that takes a long time to complete. Producers and Consumers of the blocks will essentially sleep for x amount of time and then post a message to another block. We…
0
votes
1 answer

TPL BufferBlock.ReceiveAsync receiving same item twice

I have a BufferBlock setup like this. _inputQueue = new BufferBlock(new DataflowBlockOptions { BoundedCapacity = 1, CancellationToken = cancellationToken, EnsureOrdered = true }); Have multiple consumers calling the…
0
votes
1 answer

TPL Dataflow Complete Pipeline when condition matches

I thought it's very basic approach but I haven't found any example yet. I have one producer and one consumer and I want to finish the pipeline when at least x objects were processed. Additionally I need to know what objects have been…
0
votes
1 answer

Task.WhenAny acting like Task.WhenAll

I wrote a little program to test using BufferBlock (System.Threading.Tasks.Dataflow) to implement a dual-priority consumer-producer queue. The consumer should always use any items from the high-priority queue first. In this initial test, I have…