Natty_1 0 Newbie Poster

According to your variant write a program. That program reads a sequence of positive numbers from standard input. The sequence is terminated by number 0 and does not include that 0. For each number in sequence program should create a new thread. The thread gets some how the value of appropriate number and a handle of thread created for previous number or INVALID_HANDLE_VALUE if the thread is created for first number in the sequence. Each of that threads do the following:

Try to suspend a thread which handle it gets.
Test the retrieved number.
Resumes previously suspended thread.
Exit with code corresponding to result of step 2.
The program reads a path to some program from standard input then creates a new process after all additional threads have finished. The created process for each possible thread exit code gets environment variable with name 'tecXXX' where XXX replaced by value of exit code and the number of threads terminated with this exit code as value. The program waits until a new process initial thread termination.

1) If number is greater than 81 then thread exits with code 6. If number is less than 22 then thread exits with code 14. Otherwise thread exits with code 103.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.