Asynchronous algorithms
In this tutorial we will discover the concept of using user defined algorithms with the classes from the ILNumerics.Algorithms namespace.
In the synchronous algorithms tutorial we already discovered the concepts of implementing
synchronous algorithms with ILNumerics.Net. This tutorial will demonstrate how to write and implement asynchronous algorithms with the ILAsyncAlgorithm class.
The ILAsyncAlgorithm class should be used as base class for
- long running algorithms
- algorithms which must support user interaction like cancellation, algorithm suspending and -resuming
- algorithms firing events compatible with the System.Windows.Forms controls threading model
ILAsyncAlgorithm is an abstract base class for all asynchronous algorithms. Using it brings the following
advantages:
-
ILAsyncAlgorithmderives fromILMath. Therefore all functions ofILMathare directly adressed from within member functions ofILAsyncAlgorithmand its derivates without theILMathidentifier. -
ILAsyncAlgorithmimplements an intuitive eventing model which can be used to inform users of the class about state and progress of the algorithm - optional in their own threading context which will be important to directly interact withWindows.Formscontrols froom within handler functions of algorithm events. -
ILAsyncAlgorithmexecute in a seperated thread and provide functions for flow control.
The next sections will help users of ILAsyncAlgorithm using and accessing implementations of algorithms. Implementors of ILAsyncAlgorithms will learn the steps needed to implement their own user defined asynchronous algorithm classes.
Read about the following topics: