Hello everyone,
Here is the situation, I have two sets of threads, Mappers, and Reducers
Mappers parse a text file and send individual words with there line numbers to a reducer thread based on a hash function
Reducers have a fixed buffer size and place each word in that buffer to a single list
I have Mappers and Reducer threads into separate Pthread arrays
For example:
[Step 1] For the word "example" Mapper thread produces a hash value of 3
[Step 2] Mapper thread puts "example" and its line number in the 4th
reducer's threads (0,1,2,3) buffer
[Step 3] Reducer thread #4 will place "example" with its
line number to the list
Please inform me if this is not clear.
The Problem
I can not figure out how to pass information from the mapper thread to the appropriate user thread so Step 2.
Can anyone shed some light on how I can do this ?
I hope my description is clear enough however I can share some code if it helps.