# Minimal Program A minimal program based on the Tasking Framework contains at least one channel, one task and one scheduler. Channels and tasks have to be specializations of the classes Channel and Task In the following example these specializations of a [channel](./Specialization_of_Channels) and [task](./Specialization_of_Tasks) are included. The scheduler is set up by the scheduler provider class template with one executor thread and the scheduling policy FIFO. The policy of the scheduler must always match to the policy of the connected tasks. If not, unexpected behaviour is possible. ```C++ #include #include "SingleDataChannel.hpp" #include "SingleDataPrinterTask.hpp" Tasking::SchedulerProvider<1u, Tasking::SchedulePolicyFifo> scheduler; SingleDataChannel channel; SingleDataPrinterTask task(scheduler); int main(int argc, char** argv) { task.configureInput(0u, channel); scheduler.start(); channel.push("Hello World"); scheduler.terminate(true); return 0; } ``` The first step is to connect the tasks of an application to the channels. After this step, optionally `scheduler.initialize()` can be called, to do a secondary initialization step on all tasks connected with the scheduler. After set-up and initialization is done the scheduler will start. The `start` method has one optional parameter to reset all tasks connected to the scheduler at start time, e.g. when the scheduler will be restarted after a termination. By pushing data to the channel, the task becomes activated and the scheduler is signalled to process the task. Before the program will be terminated, the scheduler has to be terminated to stop the executors in a safe way. In this example, the termination call waits until all activated tasks are executed before all executors of the scheduler terminate. The default behaviour is only waiting on the termination of all executors. In the example, most of the time the task is not processed before the scheduler terminates the executor. It is clear that a Hello World example will not show the full application of the Tasking Framework. More useful are seqeuences of processing steps on concurrent streams. When channels are also pushed by the hardware interfaces, good performance for your application can be achieved.