Get the Code Here :
Best C# Book :
Support me on Patreon :
In this part of my C# tutorial I’ll cover threads in depth. With threads you can execute multiple pieces of code that share resources and data without corrupting it. I cover a simple thread example, sleep, a more advanced with lock, Priority, and how to pass data to a thread.
For best results take notes on the cheat sheet provided above as you watch and leave any questions you have.
Thank you to Patreon supporters like the following for helping me make this video
facebook.com/cottageindustriesbuild/
jaryd remillard : instagram: @distant_admiration
bugreplay.com
@kyleaisho
@thetwistedhat
vjFaLk
jaryd remillard :
Nguồn:https://wijstaanvooronzegrondrechten.org/
Xem Thêm Bài Viết Khác:https://wijstaanvooronzegrondrechten.org/cong-nghe
well, HEllow internet
It bothers me that you use doubles for a bank account instead of decimals :p
oh man , I want to know how to use [cw] .but I can't find that video.. can you give me a link of that ?
hey mister bananas you da goat
I've a question,
If the thread number 2 tries to acces into the lock statement while any other thread is executing the same lock statement, the thread number 2 would wait until the other one gets out of the statement or until the other thread is died.
Still struggle to implement multithreading in bigger applications … just not an easy topic to do it well.
Hi Derek !
im trying to use Thread for disabling my UI buttons while an operation is execting (button click to start it) .can you help me .
Too much confusing. Looks like you talking and teaching yourself….
Was Print1() ever called ?
Hi Derek. I've removed the lock statement from this code, and balance does not go below 0 when I execute the code. It looks like lock doesn't do anything in this example. Please explain. Thank you.
Rhodium
Great tutorial, but when I run the last example I'm getting an output of 1-10, 1-5, 1-6 in order. Do you know if anything might have been updated since you made this video?
Thank you
Locks will block other threads from executing the code contained in the lock block. The threads will have to wait until the thread inside the lock block has completed and the lock is released. This does have a negative impact on performance in a multithreaded environment. If you do need to do this you should make sure the code within the lock block can process very quickly. You should try to avoid expensive activities like accessing a database etc.
Would the 1st program work on a Pentium 3 single core, single thread CPU?
honestly , i didn't understand why using the lock , you didn't provide an accurate example , i don't understand what is it doing spcial , couldn't you do that with ( else {} ) ?
thanks for the tutorial you are pretty good teacher 😉
5:35 Goals for 2019 😛
can someone explain the private Object acctLock = new object(); to me i don't understand. Was this explained in another video?
Thanks for the video. Sounds like you like the VS shortcuts (cw for Console.Writeline), and noticed that you were writing out for loops manually. You can do a shortcut for a lot of things with the tab tab including for, while, if, etc. My personal favorite is switch statement for an enum: if you put the enum in the switch parameter and hit enter, it auto fills your entire case block. HUGE time saver.
Thanks a lot!
Man you add things there and there so fast, for someone new to that it might be impossible to follow.. 😀
Hey is it possible to use threads to run in the background to capture serial data real-time in a c# wpf application??? I'm asking as I'm experimenting with a xbee radio and I can only get data in my application to capture serial data once when executing.
Why did it print 0 first in the output?
Why not 1