Advanced VB.NET Programming – Threads, Events and Delegates (Part 2)

preview_player
Показать описание
This is the second of two computer science lessons about threads, events and delegates. In these two lessons, you will learn how to create a multi-threaded racing game in Visual Basic.NET. The application makes use of the .NET Thread class, which allows you to build responsive applications that can run multiple sub programs at the same time. The game employs custom events to signal changes while the application is running, and delegates, otherwise known as type safe method pointers, to safely marshal method calls between threads. By following along and building this application yourself, you’ll come to see that threads, events and delegates are closely related. To get the most out of this video, you should already be familiar with the basics of high level programming. It would also be advantageous to have some familiarity with object oriented programming. You can find the essentials of object oriented programming with VB.NET in a separate series of computer science lessons. If you’re a C# programmer you still find these videos useful because, although there are some differences in language syntax, the fundamental concepts are the same.

Chapters:
00:00 Introduction
01:10 Write a custom event and an event handler
02:56 Raise an event
05:00 Race condition
07:24 SyncLock
08:30 Dynamic event handler assignment with AddHandler
09:45 Abort a thread
12:29 ThreadAbortException
14:54 The benefits of events?
17:17 Run an event handler on a separate thread
18:45 Cross thread operations
Рекомендации по теме
Комментарии
Автор

Thank you for your time in putting together these videos. They have helped tremendously! I hope to see more!

dford
Автор

Very informative and taxing on my old brain. But the more I study, the easier it all becomes. Like, when I changed the exception to ThreadAbortException it had a red squiggly under it. My first thought was, I probably have to Imports some Thread business, and viola. Thanks for challenging me and making me THINK. I'll be sad when I run out of your vids. I appreciate you....JT

jtlunsford
Автор

I'd really like to see something on COM as an intercommunication method, and also one on WMI as a method of examining a vast range of computer information. There's very little out there on COM, and what does exist re WMI is largely out of date using VS 2022, or just plain wrong. Many thanks.

daveevans
Автор

where I can download code sample of this practice?

joaquinortiz
Автор

could you elaborate on how "addhandler" being dynamic and "handles" being static?

westikle
Автор

This was such an informative video! If you're into programming, you'll love my channel too.

MyCodingDiary