courses:high_performance_computing:producer_consumer
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
courses:high_performance_computing:producer_consumer [2023/04/18 11:09] – odoronin | courses:high_performance_computing:producer_consumer [2024/03/04 02:01] – 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 should use this waiting only for debugging your code | ||
+ | // For the 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 should use this notification only for debugging your code | ||
+ | // for the 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 should use this waiting only for debugging your code | ||
+ | // for the 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