Scalar product example added for threads.