Category Archives: C#

C#. PLINQ Example

123

 

Posted in C# | Comments Off on C#. PLINQ Example

C#. Simple Parallel Example

Source

 

Posted in C# | Comments Off on C#. Simple Parallel Example

C#. Parallel and Task Example

System.Threading.Tasks.Parallel

 

Posted in C# | Comments Off on C#. Parallel and Task Example

C#. Safe and unsafe thread calls to controls

from MSDN

 

Posted in C# | Comments Off on C#. Safe and unsafe thread calls to controls

C#. ThreadPoolExample

CLR Thread pool – more effective way to manage threads Limitations -only background threads -non identified…

 

Posted in C# | Comments Off on C#. ThreadPoolExample

C#. Timer and threads

Some task that can be periodically called by timer in thread

 

Posted in C# | Comments Off on C#. Timer and threads

C#. Threads Synchronization

No synchronization example – full chaos during execution…

Synchronized with lock example

Synchronized with Monitor System.Threading.Monitor has more options like Monitor.Pulse(), Monitor.PulseAll()

  Also possible synchronization with System.Threading.Interlocked and [Synchronization] attribute, which is below, class should be … Continue reading →

Posted in C# | Comments Off on C#. Threads Synchronization

C#. Foreground and background threads

Foreground thread – thread that is critical, application will not end up to thread will not be finished. Background thread – not critical, it can be interrupted during application close example

 

Posted in C# | Comments Off on C#. Foreground and background threads

C#. Creating own threads

example shows – thread statictics -start thread without params -start thread with params -waiting of Thread which starts other threads… with AutoResetEvent handle

 

Posted in C# | Comments Off on C#. Creating own threads

C#. System.Threading and other examples

System.Threading and System.Threading.Thread main types to work with threads directly example

During debugging… we can see what is happening to threads… Debug > Windows > Threads ThreadStart Example

 

Posted in C# | Comments Off on C#. System.Threading and other examples