Tag Archives: Multithreading

C# – Concurrent collections

By | 06/03/2024

In this post, we will see some concurrent collections that we could use in our multi-threaded application where, managing shared data between threads, can introduce complexity and potential error such as race conditions or deadlocks. .NET addresses these cases with its concurrent collections, found in the System.Collections.Concurrent namespace. These collections are designed to be thread-safe… Read More: C# – Concurrent collections »

Python – Multithreading (introduction)

By | 12/04/2023

In this post, we will see how to use multithreading in Python, following the posts that I created for C#.How we know, multithreading is a programming technique that allows multiple threads of execution to run concurrently within a single process. Each thread can perform a different task or execute a different portion of code, and… Read More: Python – Multithreading (introduction) »

Multithreading – SemaphoreSlim

By | 01/03/2023

In this post, we will see what is SemaphoreSlim and how we can use it.But first of all, what is SemaphoreSlim?From Microsoft web site:“The SemaphoreSlim class represents a lightweight, fast semaphore that can be used for waiting within a single process when wait times are expected to be very short. SemaphoreSlim relies as much as possible… Read More: Multithreading – SemaphoreSlim »

Multithreading – How to return a value from a Thread

By | 13/10/2021

In this post, we will see how to return a value from a Thread. First of all, we create a new Console application project where we define three methods called Method1, Method2 and Method3: Then, we modify the Main method in order to run the first two methods in different Threads: If we run the… Read More: Multithreading – How to return a value from a Thread »