I have 3 functions:
- ReadInput (Reads the array of strings).
- Process the string (Reverses the string) [PARALLEL PROCESSING in MULTITHREADs]
- WriteOutput (Write the processed string to an output array)
For example: String Inputarr[] = {"RAM", "SHYAM", "CAT"}; It should write into Output Array as {"MAR", "MAYHS", "TAC"}
So the problem here is: I am reading from the InputArray in a sequence and then it is processed by multiple threads parallely, then how the threads will write into OutputArray in the same sequence as it was read from InputArray? Who decides the threads order to write?