Threads

Hi

I have a program that can use an odd or even amount of threads - based on a passed in parameter - being used on any run of the program. If each thread fetches an ascii character from a file, what would spin meaning this context ?

I know I need to use waits.

Eg file:

****
**
****

Thanks
I would assume that "spin" in this context means a "spinlock" which is a method used to make sure threads don't trample each other.
Ok that makes sense.

So what path would I follow in order to make each thread print one *. This is all contained in a function which takes in an int which represents how many threads to use.

Would I also need a check to see if the int value is even or odd ?
Topic archived. No new replies allowed.