Wednesday 16 December 2015

Multithreading, basics part 1.

Background -

Before we jump into multi threading, let us see it's background.

During initial days of programming, programmer never thought of parallel programming. We were more depend on the speed of processors. From programming skills point of view, we were more focused on using good data structures in our programs with optimized time and space complexity, then writing parallel programs. 

Performance of the processors were increasing every year. Thanks to AMD, Intel, Nvidia and other chip maker who has been developing small but fast processors year by year. How we were able to achieve better performance consistently year by year? because of Moore's law, but soon after processors hit the performance wall, and couldn't go further in terms of performance, with single core design.



Below is the block diagram of single core -




Then chip maker companies decided to go with multiple core in one processor, and invented dual core processors first. After hardware industry discover multi core in a single chip, Operating systems were the first software who utilized it properly and come up with fast OS, but application development were not fully migrated to parallel programming or multithreading.




block diagram of multi core processors -




Speed/performance has been always a big plus point of any software product. Now a days we are talking about - complex big data problems, machine learning algorithm, data mining algos of large data. We have to come up with parallel programming skill set where we can actually utilize the power of multi core processors. 

Running single threaded application on multi core processor has no big benefits. Writing your programs knowing the latest hardware architecture will make it even faster.




1 comment: