Saturday, 7 February 2009

Intel releases updated concurrent C/C++ tools

Intel Corp. has announced version 0.3.0 of its Concurrent Collections for C/C++, downloadable from the company's site.

Among the new and updated features Release 0.3.0 includes are: steps that can now be specified with different priorities to improve performance; support for garbage collection by ref-counting to reduce memory usage.

The collections provide the tools for constructing C++ programs that execute in parallel while allowing application developers to ignore issues of parallelism such as low-level threading constructs or the scheduling and distribution of computations.

The model lets programmers specify high-level computational steps including inputs and outputs without imposing unnecessary ordering on their execution. Code within the computational steps is written using standard serial constructs of the C++ language.

Data is either local to a computational step or it is explicitly produced and consumed by them. An application in this programming model supports multiple styles of parallelism (e.g., data, task, pipeline parallel).

While the interface between the computational steps and the runtime system remains unchanged, a wide range of runtime systems may target different architectures (e.g., shared memory, distributed) or support different scheduling methodologies (e.g., static or dynamic).

Intel is also providing a runtime system for shared memory systems that supports parallel execution although it is not yet highly optimised.

The birth of C++

In the coming two years after C was released, the code written in C began to suffer from a problem. As the programmers harnessed the power of Personal Computer, the software grew more complex, and the C programs have gotten longer and longer. This meant that these programs were also harder to maintain. Some functions needed to communicate with other functions, but there was no standard way of thinking about data organization. In long programs, the code was practically infested with functions in the global scope. One of the few ways to separate data was by using separate C header (.h) and C source (.c) files. Other than that, the language's features that would help organize the code to ensure readability of large programs were simply missing.

There had to be a solution. In 1983, Bjarne Stroustrup developed such a solution, and named it the C++ programming language. He drew inspiration from some of the previous languages that allowed object-oriented programming. One of those languages was Simula67. It can be said that one of the greatest addition to C's supset, the C++ language, was that C++ introduced programmers to the concept of an object. An object is an abstraction of a problem. Not only does the use of the concept of objects in a programming language reduce the size of the program, it also makes the program much more readable and compact. The notion of objects gave the origin to the concept of Object-Oriented programming which I discuss in my Introduction to Object-Oriented Programming.

Why was it named C++?

Initially the C++ language was named "C with Classes" because you could still write C-like programs in C++ but you could also use what we call classes. I will be sure to talk about classes and other object-oriented C++ concepts in the following tutorials. You might ask, why a successor to C is called C++ and what is this double plus sign business all about? If you were writing a program in C and you wanted to add two numbers together such as 1 + 1, in the listing (or source code) of your program, you would write it just that way as: 1 + 1. Notice that in computer programming, the plus sign is called an operator, it directs the compiler to add two values together. Plenty of times programmers need to add the digit 1 to another digit stored in what is called a variable. Because of the frequent use of these simple arithmetics in general computer programs, a new operator called postfix increment (represented by a double plus sequence: ++) may be used to simply add 1 to the existing value, thus avoiding the redundancy of typing: 1 + 1. It just makes the program code look cleaner and easier to read. Therefore, you can see that the expression C++ actually has a meaning. It is C incremented by 1, or in other words, a version of C programming language that contains additional features. You may also think of C++ as an augmented version of C.

On the other hand, the reason the C programming language is called C, is that it is a successor to the language called B. Simple isn't it? Strange as it is, there was never a programming language called A. Or as far as we know, if there was a language called A, it never saw the light of success or popularity. If you are interested in learning about how C++ falls into the history of computer programming languages, you may want to look at the chart of evolution of computer languages. This hierarchy shows where each computer language came from. As you can see the Assembly Language (which is a low-level programming language) on this chart is located in the upper left corner because it is one of the first languages ever designed and can be considered the grand-father of all computer programming languages. Additionally you may be able to gain an insight from the list of programming languages by date that lists languages in chronological order.