Open Source & Linux Lab

It's better when it's simple

User Tools

Site Tools


courses:high_performance_computing:producer_consumer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
courses:high_performance_computing:producer_consumer [2022/02/12 12:52] kelcourses:high_performance_computing:producer_consumer [2022/09/15 11:36] odoronin
Line 26: Line 26:
  
 <file cpp> <file cpp>
 +#include <iostream>
 +#include <fstream>
 #include <pthread.h> #include <pthread.h>
  
Line 32: Line 34:
  
   // Read data, loop through each value and update the value, notify consumer, wait for consumer to process   // Read data, loop through each value and update the value, notify consumer, wait for consumer to process
-  std::ifstream if("in.txt");+  std::ifstream ifs("in.txt");
   // ...   // ...
 } }
courses/high_performance_computing/producer_consumer.txt · Last modified: 2024/03/04 02:19 by odoronin