Tag Archives: C#

The future’s wide open… open source!

Hey, I just released my very first contribution to the world of open source software! It’s basically not a really big thing but while I’ve been researching about a reasonable and stable multi-threaded producer/consumer problem implementation C#, I quickly found out that there are not many resources out there on that topic. Oh wait… That is to say: There are hefty amounts of resources on that topic, but all of them are just forum posts like “can you help me with that” without really helpful answers. A few hits I had were actually trying to solve the problem but most of them were contradicting the other possible solutions. I think you can see where this was going…

I expanded my search and eventually ended up deep-diving into the .net Framework and its crappy documentation and teaching all that fancy multi-threading stuff to myself. I came up with a small, probably helpful example that I wanted to share with the world 😉 It can be used in other projects because it’s completely generic and hides all the threading magic inside the three classes. If you think it’s too much overhead for your project or the way the produce() and consume() methods are called doesn’t fit into the workflow of your project, you still can check it out in order to learn a little bit.

I called it tspcp (thread-safe producer-consumer pattern) and just released it on github. Feel free to fork! :mrgreen: