Thread approach Q
All threads need to be done using the POSIX or pthread.h and compile in Unix. G++.
The project needs to use 6 threads, 2 to open 2 files, 2 to calculate based on its data, and 2 to write to 2 other files.
-In the main function, the outfile is opened and wiped. Two threads are spawned and go to a getFile() function for opening.
-The getFile function does indeed open the files, gets the data, spawns 2 more threads and passes the number to another function, testPrime().
-The testPrime function uses mutex before calculating and performs the calculations. It then calls a writeFile() function, that accepts 5 arguments.
-The writeFile() function does not work at all with threads, so I have it threadless. I really have no idea what to do here.
Basically, the program works, but not in the desired way it's supposed to. Can anyone tell me if what I'm doing is a very bad idea or what...?
Here's my other post with some code snippets in it: http://www.dev-archive.com/forum/showthread.php?t=435605

