Hi. I have been assigned a task that has me stumped. I am to create 3 threads, parent and children, using the fibonacci sequence. I have two problems.
1) The first is getting my functions to work properly.
My first function successfully generates the number of Fibonacci numbers given by the command line. For some inane reason I can't figure out how to write a function that adds 1 to each number (in a separate thread) and another function that subtracts 1 (in a separate thread). I get all sorts of wacky computations.
2) The second problem is getting my threads to accept my fibonacci data.
I was successful in creating 3 threads, but they are generic and as a start I am unsuccessful in making my original fibonacci sequence fit into the first (parent) thread.
My program currently successfully asks for an input and spits out the number of fibonacci numbers asked for. But then it runs 3 threads showing me a set number and thread number, but with no fibonacci data linked. It is just printing my out statement to the console. I have it set to run 10 sets, for each thread.
So I need to know how to get my three functions each into the threads successfully. Even if it had the same info every time, it would be great to just see it using my fib data. Every time I add anything to my threads the code breaks.
I'm happy to paste my code here, but I'm not looking for anyone to do my work and I didn't want to be presumptuous. Any advice is helpful.