Back to Browse

C# Threading

269 views
Apr 10, 2022
22:16

Time Description 0:13 Human body can do things concurrently. Breathing, blood circulation and digestion. 0:30 Computers can also do things concurrently. 0:49 Multithreading – applications contain threads of execution. Each thread performs a portion of the program that may execute concurrently with other threads. 1:23 Namespace is System.Threading 1:30 The garbage collector thread reclaims memory. 1:50 A thread method must return void and take no arguments 1:55 A thread can be stopped by calling the Thread method Abort 2:00 Calling abort throws a ThreadAbortException in the thread 2:10 A thread can call the Thread method Sleep 2:20 Thread Priorities 2:22 Lowest, BelowNormal, Normal, AboveNormal and Highest 2:30 Threads default to Normal 2:44 Windows uses a concept called time slicing 3:07 Basic Threading Program 3:50 No Sync Program 6:20 Sync Program 10:40 Thread Synchronization 10:43 Use when you have shared data that may be changed by multiple threads 11:00 Problem is solved by giving one thread exclusive access to code that manipulates the shared data. 11:05 During that time other threads that are going to manipulate that data should be kept waiting. 11:17 Class Monitor is used for locking objects to implement synchronized access. 11:25 Locking an object means that only one thread can access that object at a time. 11:55 Use Monitor.Enter method to acquire a lock on that object. 13:10 Use Monitor.Exit method to release the lock 14:25 Or can use the “lock” keyword, when the lock block terminates for any reason C# releases the lock on the object. 12:08 Monitor.Wait method releases a thread’s lock on an object and waits for another thread to pulse it. 12:42 Monitor.Pulse is used to pulse starts the first waiting thread 12:45 Monitor.PulseAll starts all threads that are waiting 15:30 User Interface threading 15:40 UI can only be updated via the UI thread 16:00 Threading program 20:10 Threading WPF program

Download

1 formats

Video Formats

360pmp429.6 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

C# Threading | NatokHD