For my C project I am required to generate random x and y coordinates between -1 and 1 and then test to see if there within an area of a square. However I am required to use pthreads to run multiple test and I found out that the normal rand() function does not create new numbers for each thread. Based on what I have found online you need to use rand_r, but I could not find a good example on how to use it with threads. So if someone could help me understand it better with a example that would be great.
Thanks
Aucun commentaire:
Enregistrer un commentaire