Click here to Skip to main content
15,610,223 members
Everything / General Programming / Threads



Great Reads

by Maxim Kartavenkov
Articles describes how to create virtual video capture source directshow filter in pure C#
by Maxim Kartavenkov
Article describes how to make H.264 Video Encoder DirectShow Filter using NVIDIA encoder API in C#
by Sergey Alexandrovich Kryukov
Addresses questions on graphics, threading with UI, form development, printing and more
by honey the codewitch
Take control of which thread your code gets executed on, and how it does

Latest Articles

by Bruno van Dooren
What to do when you want to use the current thread handle
by Bruno van Dooren
How to implement named pipe server for communicating with client apps
by Bruno van Dooren
How to implement named pipe server for communicating with client apps
by Greg Utas
Keeping a program running when it would otherwise abort

All Articles

Sort by Score


1 Jul 2019 by Lance Roberts
A tray utility for monitoring log files and popping up error messages
27 Dec 2022 by Bruno van Dooren
What to do when you want to use the current thread handle
12 Jul 2013 by SabirDeveloper
Handler for WaitAll() and WaitAny() limitation problem.
4 Mar 2010 by Simon P Stevens
This code provides SafeTrigger extension methods as a way of triggering events in a thread safe way.For details on usage, a discussion of reasons and alternatives, and a full solution download see my article on safely triggering events[^]Multiple overloads are provided for convenience to...
3 Oct 2011 by Karthik Kalyanasundaram
Do you really need an explicit call to _endthreadex() in your thread function created using _beginthreadex()
29 May 2013 by Surendra Adhikari SA
Implimenting a message box that closes automatically using thread.
24 Apr 2014 by idonotexistatall
How to make an HTTP Server and some documentation on server-side protocol
22 Jun 2011 by Andrew Rissing
A simple trick to remove the delay of Thread.Sleep for unit testing.
27 Apr 2010 by Timmy Kokke
When writing a demo for the Dutch Code-camp  I ran into issues getting back on the UI thread after calling a webservice. The call to the webservice was made from the UI thread, but the callback was made on a different thread. The System.Threading.SynchronizationContext class held the...
5 Oct 2012 by Bryan Lyman
Generic list wrapper that returns a smaller strongly typed sub-list which modifies the parent-list when changed, without using events
15 Feb 2013 by essence
ConcurrentDictionary's methods can call your value factory more than once.When is this a problem? How can it be overcome?
11 Jun 2014 by Sen Jacob
This is an alternative for "A Task Scheduler Library for .NET Applications"
6 May 2016 by Steffen Ploetz
How to provide modal UI application components without leaving the UI thread or pause/block it
14 Mar 2019 by Martin Vorbrodt
Advanced thread pool
13 Nov 2010 by venugopalm
Calling thread cannot access this object because a different thread owns it
25 Dec 2011 by Paulo Zemek
This code is buggy.See the line:if (Monitor.TryEnter(po1) && Monitor.TryEnter(po2)) return;Imagine that the lock to po1 is true, but for po2 is false (or vice-versa).It will not return, and later will lock po1 again.So, when unlocking, it will unlock the wrong number of...
13 Feb 2013 by essence
Make your synchronizion easier by using Read/Write extensions.
18 Mar 2013 by PavyBez
OrderedLock in C# to catch potential deadlocks at runtime
5 Jun 2016 by Steffen Ploetz
How to implement modal windows with OpenTK on Linux, that behave like dialog boxes on Windows
13 Nov 2018 by Vlad Neculai Vizitiu
LinqPAD Script of the Day: WorldClock
15 Mar 2019 by Martin Vorbrodt
Simple thread pool
15 Mar 2019 by Martin Vorbrodt
Fast semaphore
15 Mar 2019 by Martin Vorbrodt
Blocking queue
16 Mar 2019 by Martin Vorbrodt
L1 cache lines
23 Jan 2011 by Sergey Alexandrovich Kryukov
A generic class to be used as a conveyor for data and tasks between threads
30 Jul 2016 by Wonde Tadesse
How to utilize QueueBackgroundWorkItem(QBWI) for web applications that run a background process in IIS environment.
4 Aug 2017 by Sharp Ninja
Threading can be a daunting topic. This library takes much of the worry (and mistakes) out of multi-threaded application programming.
6 Jan 2014 by User 468701
Task.Factory.StartNew can be very useful for executing a method on another thread where you don't care about the result, but it can also make the host method hard to test. This tip describes how to inject Task.Factory and mock it for testing.
6 Mar 2013 by Ahmed Elkafrawy
An easy way to simulate keyboard press & release keys to another application
24 Dec 2013 by Senthilvel Samatharman
This tip provides a simple implementation for the ICommand interface and enables to write quick code leaving the nuances of fetching the return types and asynchrony
13 Feb 2014 by Anand Gunasekaran
Scanner automatically scans multiple pages using BackgroundWorker Thread
13 Dec 2012 by suis
Integrating Google direction and geocoding services using C#. NET code behind.
10 Jun 2014 by Sen Jacob
A simple task scheduler utility by which you can schedule a task to run at any time or interval
31 Oct 2018 by Arun Babu Madhavan
Extension method to throttle multiple Tasks in C#
11 Apr 2014 by codemunkeh
Lock has pitfalls: let's use Monitor.TryEnter with less boilerplate
14 Oct 2014 by Bartlomiej Filipek
Simple introduction to std::future and std::async and why they can be useful.
18 Jan 2014 by Thrivikram Hathwar
How to broadcast data using .NET TPL dataflow
27 Aug 2015 by Chandra Shekhar Joshi
How to implement the Queue of Background Worker
14 Nov 2014 by Hrishi Gupte
Processing Collection in C# .NET using multiple threads
23 Apr 2014 by mohamedkamaleed
22 Jan 2014 by Ger Hayden
Working introduction to Parallel Programming
24 Jan 2011 by dwilliss
In .NET 4.0, you can use:New Concurrent.BlockingCollection(New Queue)This even has an option on the constructor to let you specify a maximum queue depth. If it reaches this depth, a call to Add will block until the consumer thread takes something out of the queue.
15 Jan 2013 by Alessandro Lentini
How to write a simple multi-thread queue for the typical producer-consumer process
23 Mar 2013 by AfnanMof
Steps How to Develop Sharepoint Windows Forms
18 Nov 2012 by Anwaar Ahmed
Performing the same task with and without using threads
14 Jan 2014 by Asif Bahrainwala
Atomic set and test in critical sections
28 Apr 2018 by Eddy Vluggen
You've been taught to give every component and variable a descriptive name; why do most then don't do it for a thread, when it is easy and beneficial?
21 Apr 2013 by Eduardo Antonio Cecilio Fernandes
Add asynchronous tasks, using threads, in Android activities while updating its progress to the UI. Use this technique for SDKs lower than 1.5.
11 Apr 2012 by Tony Dubey
Huge improvement on Multithreading in new Task Parallel Library for .NET 4
29 Apr 2020 by honey the codewitch
This tip shows you how to do UI updates without having to worry about locking.
8 Nov 2011 by manish31383
How to do controlled ThreadPooling using .NET Framework 4.0.
25 Apr 2014 by grantliu
Utilize in a Service-oriented architecture
30 Sep 2018 by Steven Coco
This illustrates a simple pattern that provides a lock that can always be invoked; and may be a no-op for a non-synchronized implementation.
1 May 2020 by honey the codewitch
Creating an application that can run once, but then accept command line args from subsequent runs
30 Oct 2013 by Marc Leger
ORM, databinding, asynchronous data access, and transactions
27 Mar 2013 by metastruct
Multithreaded, customizable SysLog server in C#.
8 Jan 2013 by evry1falls
Receiving response correctly from pop mail server is the first step on receiving emails to your own email client.
3 Jun 2010 by Kunal Chowdhury «IN»
Working with event handler
24 May 2012 by Evgeniy Sukhikh
The most elegant implementation for VB.NET and safe as simple
24 Jul 2013 by Jean A Brandelero
Learn how to do cross-thread operarions, the easy way!
6 May 2010 by Sarang Date
Introduction My Colleagues Guru and Amit brought an interesting discussion on the use of timers in a multithreaded environment. I have tried below to clarify a few things about different timer classes and their usage scenarios with pros and cons. This info is based on the various blogs I...
25 Dec 2011 by FDW
Lock multiple (up to 2) objects, non blocking