How the future of the software industry looks like ?
Unfortunately, the processing power of the computers will not increase dramatically in the next decades. This situation makes low level programming languages more popular ( C/C++, Ada etc ). On the contrary, to learn these languages very difficult. For a moment, let we assume that the software industry has qualified C++ programmers. Although, it brings us some advantages, it can not solve the problem totally. We need to make the software parallel.
Why parallelism is necessary ?
The problems of heat dissipation and energy consumption now limit the ability of hardware manufacturers to speed up chips by increasing their clock rate. This phenomenon has led to a major shift in computer architecture, where single-core CPUs have been replaced by CPUs consisting of a number of processing cores. Therefore, not surprisingly, in order to exploit the full potential of multi-core hardware, there is an unprecedented interest in parallelizing the computing tasks that were previously conducted in series.
This trend forces parallel programming upon the average programmer. Even though there are many way to achieve concurrency in software systems, in general-purpose software engineering practice, we have reached a point where one approach to concurrent programming gains popularity, namely, threads.
What is the problem on the standard threading libraries ? - Why the Pcynlitx is necessary ?
Unfortunately, writing multi-threaded programs is still difficult for a variety of reasons. The biggest problem on thread programming is non-deterministic scheduling of the threads. Different runs of a multi-threaded program may show different behaviors depending on how the threads interleave. It plays a crucial role on the deadlocks as well.
In practice, the operating system schedule the threads. In other words, in standard multi-threading, the programmer can not control the scheduling of the threads. However, different from standard threading libraries such as C++ threads, in Pcynlitx, the programmer can determine how the threads interleave. This power of the Pcynlitx comes from the application specific library construction process.
Why the pcynlitx produces an application specific library ?
The idea of Pcynlitx is to use another software ( a meta-program ) in order to reduce the complexity of multi-thread programming and actually, Pcynlitx is not a threading library. Instead, it is a multi-threading library generator and in each library construction process, it produces a new “application specific multi-threading library” relaying on the programmer needs. In fact, the programmers enters their preferences to the Pcynlitx and a meta program produces a new threading library based on the information that is given by the programmers.
Thanks to the application specific library construction, the synchronization tools of the libraries produced by the Pcynlitx know many application specific properties such as how many threads will be created on the process in run-time and which thread function will be executed by which thread.
How pcynlitx differs from the other multi-threading tools ?
With the help of the information coming from the programmer, the synchronization tools produced by Pcynlitx can manage the relation of the threads. In fact, these tools behave like an autonomous thread management system and update their information after each operations that is performed on the process.
Therefore, in Pcynlitx, the programmer can control the threads by means of their unique numbers and the interaction between the threads are completely determined by the programmer. The programmer can determine which thread will be blocked by which thread and how and in which place the threads will be rescued later on ( for instance, "thread " blocks "thread ", "thread " rescues the "thread " in elsewhere). Standard threading libraries don’t have such a control over the threads. In addition, threading library that is constructed by the Pcynlitx hides the most of the declarations that are actually performed on the multi-threaded program by the programmer. Therefore, the Pcynlitx reduces the syntax-complexity of C++ multi-thread programming.
In brief, the user of the Pcynlitx can directly schedule the execution of the threads. Moreover, the synchronization tools of the Pcynlitx provides absolute deadlock protection if the program is written carefully ( the synchronization tools know which thread is under blockage and how the threads which are under blockage will be activated later on) .
Is pcynlitx a programming language ? - Does pcynlitx support the other C++ libraries ?
Pcynlitx is not a language. In addition, pcynlitx does not use a special run time. It is only a tool that can be used in C++ and it produces some C++ classes for you. You can do anything that C++ supports.
Beside to this, C++ template meta-programming uses compile time meta programming. Pcynlitx performs opposite. The programmer writes a list of needs before programming and Pcynlitx produces some classes and smart pointers that are shared between the threads automatically. This method can be applied the other languages as well.
How Inter-Thread Communication is performed in Pcynlitx ?
Inter-thread communication is very difficult on standard threading tools like std::threads. However, Pcynlitx establishes a client-server relation between the threads. In Pcynlitx, the programmer makes some declarations about the classes that are shared between the threads to the project’s descriptor file. These classes are named as Inter-Thread classes and the objects which are instances of these classes are named as Inter-Thread objects.
The declaration of the inter-thread classes ( the header files of the inter-thread classes ) are read by the Pcynlitx on the library construction process. Then, Pcynlitx constructs some helper classes that are used as a connection point to the inter-thread objects. These classes are named as the client classes and the objects that are the instances of the client classes are named as client objects ( For more information, please look to the document named as programming logic of Pcynlitx and Technical Introduction to the Pcynlitx ).
The client objects has all public member functions of its corresponding inter-thread object and hold the address of its corresponding inter-thread object. On each member function call, in fact, it makes an indirection to its corresponding inter-thread object.
The client object is defined on the newly created thread's stack. The client object has a pointer member in type its corresponding inter-thread object and this pointer holds the address of its corresponding inter-thread object. When any member function of the client object is called, the client object acts a a pointer and calls its corresponding inter-thread object's member function. If the member function has a parameter, the client object passes its parameters directly to the object which is in main thread's stack.
Therefore, the programmers can directly call the member functions of the inter-thread objects from the threads by means of the client objects. In other words, the client objects can be considered as interfaces for the inter-thread objects. Moreover, in Pcynlitx, the programmer can construct smart pointers that holds memory areas on the heap and they are automatically shared between the threads. In brief, Pcynlitx provides a well establish inter-thread communication mechanism.
The inter-thread classes and smart pointers that act as connection points between the threads. More specifically, the programmer can directly make indirection from one thread to others without using raw pointers. In Pcynlitx, the programmer can pass variables between the threads by means of a regular member function call.
Can you compare Pcynlitx with OpenMP ? - Are there any advantages ?
OpenMP offers task parallelism. Its paradigm is very different. Pthreads is lower level and provides us with the power to program virtually any conceivable thread behavior. This power, however, comes with some associated cost— the programmer have to specify every detail of the behavior of each thread. OpenMP, on the other hand, allows the compiler and run-time system to determine some of the details of thread behavior, so it can be simpler to code some parallel behaviors using OpenMP. However, the cost is that some low-level thread interactions can be more difficult to program. Pcynlitx provides the power of lower level programming such as thread creation, control and termination. Beside to this, it provides also automation on some tasks and can be directly compiled by the standard C++ compilers such as gcc.
The Big Picture on Pcynlitx
The biggest innovation on the Pcynlitx is its programming paradigm. It uses some kind of intelligent software as a helper for the programming process. It may be consider as the virtualization of the programmer. We can consider the kernel of the Pcynlitx as a separate intelligent actor determines the relation between the threads and transforms the architecture of the program before programming process. This actor builds a library that makes an abstraction between programmer and the multi-threading process and it makes multi-thread programming more easy and logically understandable.
You can ask your questions directly to
the developer of the platform
Erkam Murat Bozkurt
M.Sc. in Control Systems Engineering