|Navigate Concurrent Programming topic:)|
In computer programming, an application runs in a certain process of the CPU. Every statement that is then called within the program is actually being called on that process. In essence, when a statement is being called, the CPU focusses all its attention on that particular statement and for the tiniest fraction of a second put everything else on hold. After completing that statement, the CPU resumes the next statement and so forth.
But consider for a moment that a particular statement is expected to take a considerable amount of time. You cannot keep your application on halt until the statement gets executed and done with; you would want the application to commence as smoothly as possible. It can only be possible if you can run several processes simultaneously, such that when one process is executing a statement that is expected to take some time, another process would continue doing other things in the queue and so on. Such a principle of programming is called concurrent programming.
Throughout this chapter, we will be taking a look at concurrent programming constructs present in the Java programming language.