Multithreading for approximating pi using the Monte Carlo method