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

preview_player
Показать описание
This is the first 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 Features of the game
02:00 Animate a shape with a Graphics object
05:04 Random movement
07:45 Start multiple threads
08:54 What is a thread?
11:05 The ThreadStart Delegate
14:49 Finishing touches
Рекомендации по теме
Комментарии
Автор

Excellent tutorial from an excellent teacher.

theview
Автор

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

dford
Автор

You finally upload new video, My teacher~

richardansonz
Автор

Great video!
Where can I find Part 2?

techno
Автор

how do we start the two threads simultaneously? i find that whichever thread starts first always wins the race.

westikle
Автор

Hello, in my code the "random" namespace does not exist, it gives an error BC30182: type not found. I use Visual Studio 2022, how can I solve this?

JDaniel
Автор

I don't know how many programmers still use VB, or Win32 for that matter, but this is a neat example. If you're doing C# next, any chance you could or would do it on Linux? I recently setup mono because a program I want to use was written in C#, but I'm thinking of translating it because I'd really like it to be more performant. However, it might be fun to play with it some, see if it has any features I want to copy to my own language that I haven't already done.

anon_y_mousse