Delegates for Multithreading

A couple of delegates are defined to support invoking methods. These delegates are used with asynchronous processes and multithreaded classes. The MethodInvoker class is used to create delegates for procedures that return no data and take no arguments; MethodInvoker delegates are used with the Invoke method of controls. The WaitCallback delegate is defined with a signature that takes a single Object parameter. The WaitCallback delegate is used for multithreading with the ThreadPool class. The signature of both delegates follows.

Public Delegate Sub MethodInvoker()
Public Delegate Sub WaitCallback(ByVal state as Object)

For more information on asynchronous and multithreaded programming, read Chapter 6, which provides ...

Get Visual Basic® .NET Power Coding now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.