Why application specific library construction is necessary ?
On the front page of the project web site, the structural diversity of the multi-threaded application has been indicated in the section which is named as the nature of multi-threaded applications. In brief, the following properties of the multi-threaded programs may varies depending on the requirements of the application to be developed.
How many thread will be created on the program ?
How many function routines ( thread function ) will be executed on the program ?
Which thread function will be executed by which thread ?
Will the threads share a common memory or variable ?
Will be there a communication between the threads ?
On the single threaded applications, we don’t face this diversity. Because, a single program flow stars from a one point and the same input always gives the same output. On the contrary, on the multi-threaded applications, there are multiple flow of execution and the scheduling of the threads are performed by the operating system. In other words, operating system gives the decision about which code section will be executed by which thread on particular time interval. The operating system switches the threads according to its job queue. Therefore, the threads are scheduled randomly. This is the reason of the non-deterministic scheduling of the threads. Beside to this, in a deterministic multi-threading on the each running of the programs, the code sections are executed exactly the same order. A figure which illustrates the difference between the deterministic multi-threading and non-deterministic multi-threading has been given in below.
The Figure-A depicts non-deterministic multi-threading and on each running of the program, a different scheduling scenario has been followed. However, the Figure-B depicts deterministic multi-threading and on the each run of the program, exactly the same scheduling scenario has been followed. However, non-deterministic scheduling of the threads breaks down input-output determinism of the multi-threaded software and thus, developing, debugging and testing a non-deterministic multi-threaded application is very difficult.
Now, let us remember that the structure of the multi-threaded applications and the architecture of the program to be developed may change according to the requirements of the application. On the multi-threaded applications, there are infinite number of possible program structure which may change depending on the number of the threads and the thread functions. Therefore, on the multi-threaded applications, constructing a unified tool that provides absolute control over the threads for every possible multi-threaded application is impossible.
Beside to this we can consider that every possible structure of a multi-thread software defines a big set. In order to gain more control over the threads, we must strictly define the relation between the threads and perform some restrictions on this set. This is the reason why we need an application specific library construction process. If the programmer defines the number of the threads and the thread functions which are executed by the threads, a threading library that you can gives a unique number for each thread and control the threads by means of these numbers.
By this way, on the applications that is developed with pcynlitx, the programmers can set numbers to the threads and block and rescue the threads by means of these numbers and deterministic scheduling is achieved. From different point of view, we can easily said that pcynlitx totally solves the problems caused by the non-deterministic scheduling of the threads.
Return To Home Page