producer-consumer Questions

4

Solved

There is a lib that outputs its results into a given Stream object. I would like to begin consuming the results before the lib is done. The Stream should be blocking to simplify usage and avoid exc...
Diode asked 15/9, 2010 at 20:31

6

Solved

I'm using a thing called react-firebase-js to handle firebase auth, but my understanding of react and of the provider-consumer idea is limited. I started with a built a very big JSX thing all at ...

4

I'm using a named mutex to lock access to a file (with path 'strFilePath') in a construction like this: private void DoSomethingsWithAFile(string strFilePath) { Mutex mutex = new Mutex(false,strF...
Quartana asked 31/1, 2012 at 10:1

2

Solved

Suppose I have a many producers, 1 consumer unbound Channel, with a consumer: await foreach (var message in channel.Reader.ReadAllAsync(cts.Token)) { await consume(message); } The problem is that...
Longfellow asked 13/1, 2022 at 12:46

5

Does anyone know a pythonic way of iterating over the elements of a Queue.Queue without removing them from the Queue. I have a producer/consumer-type program where items to be processed are passed ...
Paladin asked 19/11, 2011 at 18:31

1

Solved

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 benchmarki...

5

Solved

I'm quite new in multithreading programming, I just know the most common Producer-Consumer-Queue. I'm using the boost c++ libraries and I don't know if is better use boost::lockfree::queue or a wr...
Incarnation asked 29/4, 2013 at 9:20

2

Solved

I would like to process some items in parallel. This processing is independent (order does not matter) and returns an output. These outputs should then be relayed back in order as quickly as possib...
Gleeman asked 3/9, 2018 at 13:15

1

I want to stream real-time sensor data(webcam, laser point cloud, etc.) from one robot to multiple observers. In this use case, only the newest data is useful. For example, when a new frame of poin...
Overrun asked 14/2, 2022 at 4:49

1

Solved

I have an app in Golang where I have a pipeline setup where each component performs some work, then pass along its results to another component via a buffered channel, then that component performs ...
Briefless asked 23/12, 2022 at 23:55

3

I want to implement producer-consumer pattern by using multiprocessing.pool.Pool Since the JoinableQueue cannot be used in Pool (would claim RuntimeError: JoinableQueue objects should only be share...
Simulate asked 3/5, 2021 at 5:16

7

i've recently come across a producer/consumer pattern c# implementation. it's very simple and (for me at least) very elegant. it seems to have been devised around 2006, so i was wondering if this ...
Traduce asked 1/11, 2009 at 4:36

1

In one of my use-case consist of consuming the data, do some operations and produce it to new topic. I'm using https://www.npmjs.com/package/kafkajs npm library. I would like to commit the offset m...
Schlosser asked 29/8, 2021 at 15:31

4

Solved

I have a producer-consumer scenario where the producer is an enumerable sequence of items (IEnumerable<Item>). I want to process these items in chunks/batches of 10 items each. So I decided t...
Hydrophone asked 20/7, 2022 at 18:35

1

Solved

I am using a Channel<T> in a producer-consumer scenario, and I have the requirement to consume the channel in batches of 10 items each, and without letting any consumed item to stay idle in a...

1

Solved

I have two threads that work the producer and consumer sides of a std::queue. The queue isn't often full, so I'd like to avoid the consumer grabbing the mutex that is guarding mutating the queue. I...
Sinecure asked 16/5, 2022 at 14:10

3

I try to implement a ConcurrentDictionary by wrapping it in a BlockingCollection but did not seem to be successful. I understand that one variable declarations work with BlockingCollection such as ...

3

I've come up with some code to consume all wating items from a queue. Rather than processing the items 1 by 1, it makes sense to process all waiting items as a set. I've declared my queue like thi...

1

I have a recursive problem where the consumers do some work at each level of a tree, then need to recurse down the tree and perform that same work at the next level. I want to use ConcurrentBag/Blo...
Historiated asked 1/6, 2012 at 14:22

1

I have a bunch of requests to process, and during the processing of those requests, more "sub-requests" can be generated and added to the same blocking collection. The consumers add sub-r...

3

Solved

I have a number of threads which retrieve data from the list of servers. The list of servers are downloaded from the server resolver every 5 mins. My threads for processing data should use only the...

4

It was said that consumers can only read the whole topic. No luck doing evaluations on brokers to filter messages. It implies that we have to consume/receive all messages from a topic and filter t...
Tourist asked 26/6, 2018 at 19:24

8

Solved

I'd like to create some sort of Producer/Consumer threading app. But I'm not sure what the best way to implement a queue between the two. So I've some up with two ideas (both of which could be en...
Species asked 25/2, 2010 at 8:15

2

Solved

How can I check if the thread I'm on is the Unity thread? I tried capturing the threadId at constructor time, but somewhere along the lifetime of the program, the threadId moves. In my project, s...
Blanchblancha asked 19/10, 2014 at 16:21

5

Solved

This is a classic c/p problem where some threads produce data while other read the data. Both the producer and consumers are sharing a const sized buffer. If the buffer is empty then the consumers ...
Kazachok asked 22/2, 2012 at 14:0

© 2022 - 2024 — McMap. All rights reserved.