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 [2023/04/18 11:09] odoronincourses:high_performance_computing:producer_consumer [2024/03/04 01:55] odoronin
Line 33: Line 33:
  
 void* producer_routine(void* arg) { void* producer_routine(void* arg) {
-  // Wait for consumer to start+  // Wait for consumer to start.  
 +  // You can use this waiting only for debugging your code 
 +  // For final solution please remove this waiting
  
   // 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
Line 42: Line 44:
 void* consumer_routine(void* arg) { void* consumer_routine(void* arg) {
   // notify about start   // notify about start
 +  // you can use this notification only for debugging your code
 +  // for final solution please remove this notification
 +  
 +  
   // for every update issued by producer, read the value and add to sum   // for every update issued by producer, read the value and add to sum
   // return pointer to result (for particular consumer)   // return pointer to result (for particular consumer)
Line 48: Line 54:
 void* consumer_interruptor_routine(void* arg) { void* consumer_interruptor_routine(void* arg) {
   // wait for consumers to start   // wait for consumers to start
 +  // you can use this waiting only for debugging your code
 +  // for final solution please remove this waiting
  
   // interrupt random consumer while producer is running                                             // interrupt random consumer while producer is running                                          
courses/high_performance_computing/producer_consumer.txt · Last modified: 2024/03/04 02:19 by odoronin