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 revisionNext revisionBoth sides next revision | ||
courses:high_performance_computing:producer_consumer [2021/10/02 23:49] – kel | courses:high_performance_computing:producer_consumer [2022/02/12 12:52] – kel | ||
---|---|---|---|
Line 2: | Line 2: | ||
Ваша задача - реализовать классический паттерн producer-consumer с небольшими дополнительными условиями. | Ваша задача - реализовать классический паттерн producer-consumer с небольшими дополнительными условиями. | ||
Программа должна состоять из 3+N потоков: | Программа должна состоять из 3+N потоков: | ||
- | - главный | + | - Главный |
- producer | - producer | ||
- interruptor | - interruptor | ||
Line 27: | Line 27: | ||
<file cpp> | <file cpp> | ||
#include < | #include < | ||
- | |||
- | void read_values() { | ||
- | FILE* file = fopen(" | ||
- | ... read(); | ||
- | } | ||
void* producer_routine(void* arg) { | void* producer_routine(void* arg) { | ||
Line 37: | Line 32: | ||
// 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:: | ||
+ | // ... | ||
} | } | ||
courses/high_performance_computing/producer_consumer.txt · Last modified: 2024/03/04 02:19 by odoronin