parallelized useing threads and trying with processes. Sharing variables not working