std::getline из разных потоков
От: makdak  
Дата: 26.05.17 14:18
Оценка:
всем привет!
Можно ли читать файл из разных потоков при помощи getline()?
в стандарте сказано: (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2760.htm)

To 27.3 Standard iostream objects [iostream.objects], add a new paragraph at the end of the section:

Concurrent access to a synchronized [ios.members.static] standard iostream object's formatted and unformatted input [istream] and output [ostream] functions or a standard C stream by multiple threads shall not result in a data race [intro.multithread]. [Note: Users must still synchronize concurrent use of these objects and streams by multiple threads if they wish to avoid interleaved characters


получается что можно и UB нет? Интересно, как реализована синхронизация чтения.
Отредактировано 29.05.2017 9:47 Кодт . Предыдущая версия .
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.