Monday, January 4, 2010

AN EXPERIMENT IN ADA

MULTIPLE CONCURRENT UPDATES IN ADA-2005

Probably the best book in Ada concurrent and real time programming is,



Pic 1. Concurrent and Real time programming in Ada-2005

In this book, in page 37 the authors discuss a program which lacks protection to multiple concurrent updates,

Pic 2. The Program

On tinkering with the program, increasing the looping; strange results are seen to happen. The program is tried with increasing looping in XP and also Ubuntu 9.10. The results are as follows;

Observations in XP ( first table ) and in Ubuntu 9:10( second table ) :


The program runs on the same body and has 2 tasks, on higher loops discrepancy is observed and issues of multiple concurrent updates are visible.

On closer observations it can be seen that XP and Ubuntu 9.10 behave little differently and the issue of multiple concurrent updates come to be at different loopings.

The reasons for such behaviour is still not very well understood by me, however modifying the program using semaphores does rectify this problem.

No comments: