Do not miss our Interview Question video series 30 Important C# Interview Questions : kzbin.info/www/bejne/eHzcn3h4hdacf68 25 Important ASP.NET Interview Questions : kzbin.info/www/bejne/ponQfpejf7p2Zsk 25 Angular Interview Questions : kzbin.info/www/bejne/Y5vIoKx6f6mmia8 5 MSBI Interview Questions : kzbin.info/www/bejne/a3abYmiXjaaqj7M
@sikeeeee8 жыл бұрын
Your videos are clear and easy to understand. In fact your tutorials including this video helped me pass the technical interviews in one of the biggest investment bank in UK. Thanks a lot.
@BinaryReader11 жыл бұрын
you shouldn't lock with "this", instead, you should lock with a private member object of that class, as the caller of the class should not have access on the object you are using to lock. Just sayin'
@santoshKoolkarni10 жыл бұрын
True but not always. Sometimes it may make sense to lock with this if the private state you are changing could have such wide implication on whole object that none of the operations can be performed without locking. for example if you are updating account balance in an account object.
@BinaryReader10 жыл бұрын
mutable state changes on a object need locking sure, but even in these instances, you would not lock on 'this'. rather, the caller(s) from the outside would be responsible for locking the account object. that "lock" would be shared among multiple concurrent processes to ensure the resource (account) is not contested. locking on 'this' removes control from the caller, and leads to confusion. even if on the outset, it appears you are doing the same work. see.... see stackoverflow.com/questions/251391/why-is-lockthis-bad As a note, i am generally against rampant locking on asynchronous operations, i subscribe the whole 'reactive' approach to software design, and am a big advocate for single threaded asynchronous execution over uncontrolled multi threaded execution. The closest analogy i could draw is possibly the nodejs execution model...tho, see the link below if you are curious about the characteristics of the system i describe. en.wikipedia.org/wiki/Reactor_pattern cheers.
@manjeetnandal15 жыл бұрын
Certainly you & your teaching pattern both are awesome. God bless you
@osnatniknazar789312 жыл бұрын
Very clear, thank you! I can not find the next video about : Monitor, Mutex & Semaphore, can you show me the link??
@mr_whyy2 жыл бұрын
You explain so well dude !
@vishakhaagrawal18228 жыл бұрын
It is a great video for learning. i could not find linked video of this one. i would like to learn mutex, monitor and semaphore too..do you have video for that too?
@rajeshsuri741111 жыл бұрын
Very nicely explained...Please post video of Monitor, Mutex & Semaphore
@stillborn00712 жыл бұрын
If a part is locked so that only the current thread can execute, what do other threads do in the meantime? Do they wait for the lock to disappear or do they skip over the part or do they skip over the complete loop? Thanks!
@Mr__B.9 жыл бұрын
Very nice! Thanks. But where is the continuation?
@Bytes-Of-Love11 жыл бұрын
Nicely explained. Please post video of Monitor, Mutex & Semaphore.
@SteveR-17019 жыл бұрын
Thanks, I'm just getting started with threading and that helped me a lot :)
@stillborn00712 жыл бұрын
Thanks for the vids. They are very useful! One thing I noticed, because your mic is a bit cracky in the beginning: I turned on English subtitles and it makes the funniest of sentences based on your narrations! :D
@tazonis19929 жыл бұрын
Realy nice video, I have one question for you. In this example you open only two threads if you open multiple treads is there a chance for a deadlock? And if there is how you avoid it? For example if more than two threads want access of Num1 and Num2 to read or to write could resolve to a tread starving for ever?(Maybe not just three threads but more likely 10000 threads doing the same thing.
@TheIcecoldorange4 жыл бұрын
@3:15 it reads: static Maths objMaths = new Maths(); How is that possible? Static means stateless...
@WoundedEgo12 жыл бұрын
VERY clear, thanks!
@RAVINDERKUMARVILASAG8 жыл бұрын
good enough to learn Thread concept
@enclavedefa112 жыл бұрын
dnfvideo I have a Question. This is the situation: I have Form with code that back's up files showin in a label th files that are being copied, and at the sametime picturebox with a Gif image is being show. How can I thread the Picturebox to show the gift mage without it to freeze when big file is being copied? Thank you.
@newbietester63217 жыл бұрын
thank you for this best tuto
@monjuilias678 жыл бұрын
Nice tutorial thanks a lot........
@atozonlineguide98935 жыл бұрын
I want to understand full OOPS concert, can anyone help me
@pablogarin8 жыл бұрын
excuse me, but wouldn't it make more sense to NOT declare the object as static? as per my understanding, both threads are using a static object, thus getting such error when calling because the values are the same across all the program (that's what static means)... Just asking because I noticed it at the very beggining and was wondering about it all along the duration of this video...
@dnfvideo8 жыл бұрын
Hello Pablo, The whole point of the video is to demonstrate thread safety so we have created a global object a.k.a static object or else we will never get a thread violation error.
@pablogarin8 жыл бұрын
.NET Interview Preparation videos yes, I guessed as much... just wanted to be sure it was the case... TY!!
@prince2378828 жыл бұрын
One doubt, the static keyword added to the 'objMaths' instance is only for the purpose that it can be accessed by static main method. The exception will happen, whenever the same Maths object is used by threads, static instance or not. Am I right?
@radnascimento12 жыл бұрын
Good Work!
@srinivasGrandhi12 жыл бұрын
nice example
@stuggyg0112 жыл бұрын
good example
@CariagaXIII10 жыл бұрын
so the lock acts like a try catch
@lolrajan12 жыл бұрын
thanks !
@ranjeetnayak7701 Жыл бұрын
There are lords of messages showing on windows so that's why we are not able to see the code properly
@killaurnext11 жыл бұрын
bro...hold the mic away from your mouth good vid overall
@GoodNewsJim2 жыл бұрын
Young programmers please do not do this! Old Programmers know better than not to do this. The only way to do multithreaded communication between threads properly with lock variables is to pass buffer string arrays of data between them. If you use lock variables for any other reason, your program will likely halt because two doors happen. One locks a door while it waits for another door to open while the other one locked that door while waiting for the other. If you don't understand what I said, you shouldn't be using locking variables.
@chrisledochowski800712 жыл бұрын
Control f fi FTW
@toolbox180011 жыл бұрын
He is doing it intentionally as an example to demonstrate how threads can lock objects.