The programming model applied to the Helixis projet is the task programming one. It is characterized by writing the code in small and simple block instructions (which are easily parallelizable). Currently, the conception of a parallelizable application is too often directed by a technical choice and its constraints.
This programming model allows one to abstract the technical problems that are mainly bound to the execution threads. By offering the user to think in a task oriented way, we lift the concurrency problems thus leaving the conception, the only problem to the user.
Helixis task system is based upon lightweight execution threads called Protothread.
Ususally, context switching between several execution threads are expensive in term of processor cycles since the stack must be copied. The protothreads strength lies in the fact that being stackless, their memory footprint is very low so their context switching is very cheap.
Moreover, for the sake of performance, Helixis uses as a complement of the protothreads, the kernel threads. Therefore, your program will have the benefits of all the available core on the host machine, and for each, the power of the protothreads.
With this design, the developer no longer has to worry about heavy thread and their inherent constraints.
Thus, the programmer ignores the resources of processors (number of cores).
In fact, the scheduler will use all the available resources without the developer changing its code, regardless of the number of available cores.
To avoid standard techniques such as concurrency Semaphores and Mutexes, Helixis uses atomic operations associated with instructions of different processors, including CAS ("Compare-And-Swap") and DCAS ("Double Compare-And-Swap").
For the sake of simplicity and performance, Helixis uses part of the library LFDS which provides all the necessary atomic operations and implementations of linked list and FIFO queue ("First in, First Out") based on these transactions.
The scheduler's role is to automatically distribute as evenly as possible and perform the tasks in a completely transparent way to the user. The task scheduling is based on the "Round Robin": tasks are simply executed one after the other in a cyclical manner.
Internally, there are two functioning of the scheduler whenWhen a task is added to the scheduler, it will put a thread in the least loaded group by following an algorithm.