Click here to Skip to main content
15,867,488 members
Everything / General Programming / Threads

Threads

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 Title

Threads 

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
15 Jan 2013 by Alessandro Lentini
How to write a simple multi-thread queue for the typical producer-consumer process
1 May 2020 by honey the codewitch
Creating an application that can run once, but then accept command line args from subsequent runs
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
11 Jun 2014 by Sen Jacob
This is an alternative for "A Task Scheduler Library for .NET Applications"
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.
14 Mar 2019 by Martin Vorbrodt
Advanced thread pool
5 Jun 2016 by Steffen Ploetz
How to implement modal windows with OpenTK on Linux, that behave like dialog boxes on Windows
6 May 2016 by Steffen Ploetz
How to provide modal UI application components without leaving the UI thread or pause/block it
13 Feb 2014 by Anand Gunasekaran
Scanner automatically scans multiple pages using BackgroundWorker Thread
27 Aug 2015 by Chandra Shekhar Joshi
How to implement the Queue of Background Worker
15 Mar 2019 by Martin Vorbrodt
Blocking queue
18 Jan 2014 by Thrivikram Hathwar
How to broadcast data using .NET TPL dataflow
23 Apr 2014 by mohamedkamaleed
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...
8 Nov 2011 by manish31383
How to do controlled ThreadPooling using .NET Framework 4.0.
29 May 2013 by Surendra Adhikari SA
Implimenting a message box that closes automatically using thread.
23 Mar 2013 by AfnanMof
Steps How to Develop Sharepoint Windows Forms
6 Mar 2013 by Ahmed Elkafrawy
An easy way to simulate keyboard press & release keys to another application
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.
15 Mar 2019 by Martin Vorbrodt
Fast semaphore
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...
13 Dec 2012 by suis
Integrating Google direction and geocoding services using C#. NET code behind.
12 Jul 2013 by SabirDeveloper
Handler for WaitAll() and WaitAny() limitation problem.
24 Apr 2014 by idonotexistatall
How to make an HTTP Server and some documentation on server-side protocol
3 Oct 2011 by Karthik Kalyanasundaram
Do you really need an explicit call to _endthreadex() in your thread function created using _beginthreadex()
16 Mar 2019 by Martin Vorbrodt
L1 cache lines
13 Nov 2018 by Vlad Neculai Vizitiu
LinqPAD Script of the Day: WorldClock
25 Dec 2011 by FDW
Lock multiple (up to 2) objects, non blocking
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...
30 Oct 2013 by Marc Leger
ORM, databinding, asynchronous data access, and transactions
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.
11 Apr 2012 by Tony Dubey
Huge improvement on Multithreading in new Task Parallel Library for .NET 4
27 Mar 2013 by metastruct
Multithreaded, customizable SysLog server in C#.
18 Mar 2013 by PavyBez
OrderedLock in C# to catch potential deadlocks at runtime
18 Nov 2012 by Anwaar Ahmed
Performing the same task with and without using threads
1 Jul 2019 by Lance Roberts
A tray utility for monitoring log files and popping up error messages
14 Nov 2014 by Hrishi Gupte
Processing Collection in C# .NET using multiple threads
30 Jul 2016 by Wonde Tadesse
How to utilize QueueBackgroundWorkItem(QBWI) for web applications that run a background process in IIS environment.
13 Feb 2013 by essence
Make your synchronizion easier by using Read/Write extensions.
8 Jan 2013 by evry1falls
Receiving response correctly from pop mail server is the first step on receiving emails to your own email client.
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...
23 Jan 2011 by Sergey Alexandrovich Kryukov
A generic class to be used as a conveyor for data and tasks between threads
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.
24 Jul 2013 by Jean A Brandelero
Learn how to do cross-thread operarions, the easy way!
14 Oct 2014 by Bartlomiej Filipek
Simple introduction to std::future and std::async and why they can be useful.
15 Mar 2019 by Martin Vorbrodt
Simple thread pool
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.
24 May 2012 by Evgeniy Sukhikh
The most elegant implementation for VB.NET and safe as simple
11 Apr 2014 by codemunkeh
Lock has pitfalls: let's use Monitor.TryEnter with less boilerplate
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?
14 Jan 2014 by Asif Bahrainwala
Atomic set and test in critical sections
13 Nov 2010 by venugopalm
Calling thread cannot access this object because a different thread owns it
27 Dec 2022 by Bruno van Dooren
What to do when you want to use the current thread handle
22 Jan 2014 by Ger Hayden
Working introduction to Parallel Programming
31 Oct 2018 by Arun Babu Madhavan
Extension method to throttle multiple Tasks in C#
3 Jun 2010 by Kunal Chowdhury «IN»
Working with event handler
22 Jun 2011 by Andrew Rissing
A simple trick to remove the delay of Thread.Sleep for unit testing.
13 May 2020 by Thomas Roll
Thread.Sleep cannot be cancelled. To inject a pause, consider using the Cancellation Token instead.
29 Apr 2020 by honey the codewitch
This tip shows you how to do UI updates without having to worry about locking.
25 Apr 2014 by grantliu
Utilize NLog.net in a Service-oriented architecture
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?