Уверена, что для знающего предмет задание не составит труда. Входные данные предоставлю исполнителю.
The application that have been developed in order to solve this task would emulate the most frequent task of many servers - data transmission and collection. Develop an application consist of two threads, besides the main (default) one. First thread emulates reading of data. The second one recording of data to database.
Data to read are in the text file and consists of records (lines) of text. The first thread shall read one line of data. Next, it shall compute the control value using just read data. The algorithm of computing the control value is up to designer but it seems that the most simple one is the XOR value taken on all characters of a line. Now, the record of data along with the control value shall be passed to the second thread via a buffer that is accessed by both threads. Before the first thread writes data to the buffer it should make sure that the current data in the buffer were already read by the second thread.
The second thread computes the control value of data received from the first thread. The algorithm of the control value must be same like the one used in the first thread. If control values computed in first and second thread are same then data can be saved into the output file. Each record of data in that file shall consists of running number of the record, control value and data. The output file is a text one.
The main thread shall wait for both working threads to complete. After both working threads would be terminated the number of records read from input file and number of records written to the output file shall be displayed.
The deliverables of the project are: design documents e.g. specification, diagrams, flowcharts etc., the project and the output file. The project shall have name fp3_lastName1_lastName2. The input file have name fp3_data.dta. The output file shall have name fp3_lastName1_lastName2.rlt.