Part of a project I am working on requires me to read from a text file of unknown size and put the data into a 10KB buffer. I have to read the file into this buffer in 2KB chunks. I must have 4 threads running simultaneously. The first thread does the reading I just mentioned.
As the thread is reading in 2KB chunks of data into the buffer, the other three threads grab the 2KB chunk read in by the reader and conduct some calculations on it. Once these threads are done they grab the next 2KB chunk and do the same calculations. This is repeated until the entire text file has been read through.
Can anyone give me some guidance as to how to proceed with this part of the project? I know how to multithread. It is just the combination of multithreading and I/O that I have not had experience with before. I have only done simple I/O before.