Skip to content

Implementing a program with two threads. The first thread reads out the values from one CSV file and sends them to the other thread once it read 10 data points. The Second thread get the arithmetic average value of these data points and store them with the UNIX timestamp in milliseconds in a 2nd CSV file.

Notifications You must be signed in to change notification settings

Abdin-Muhammad/Multi_Threading_Example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example Task : " Implement a software with two threads. The first thread reads out the values from one CSV file and sends them to the other thread once it read 10 data points. The Second thread get the arithmetic average value of these data points and store them with the UNIX timestamp in milliseconds in a 2nd csv file.

"

Explanation: This program consists of 2 threads 1st Thread "thReadData" is using method named "ReadCSV" which is storing input data from user in array "DataArr"

2nd Thread "thWriteCSV" is using method named "addData2File" which is taking average of stored data & then writing data with timestamp into a CSV file.

Mutex and conditonal variable is used to achieve parallelism between threads. for further explanation i have also added comments inside main code file.

About

Implementing a program with two threads. The first thread reads out the values from one CSV file and sends them to the other thread once it read 10 data points. The Second thread get the arithmetic average value of these data points and store them with the UNIX timestamp in milliseconds in a 2nd CSV file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages