Программы на C++. Форум разработчиков
-
Anonymous
Гарантирует ли *happen-before* порядок доставки данных в файл?
Сообщение
Anonymous »
Рассмотрим этот пример:
Код: Выделить всё
#include
#include
#include
int main(){
std::ofstream outFile("example.txt", std::ios::out | std::ios::trunc);
std::atomic flag = false;
auto t1 = std::thread([&](){
outFile
Подробнее здесь: [url]https://stackoverflow.com/questions/79855089/does-the-happen-before-guarantee-the-order-of-delivery-for-data-to-a-file[/url]
1768087729
Anonymous
Рассмотрим этот пример:
[code]#include
#include
#include
int main(){
std::ofstream outFile("example.txt", std::ios::out | std::ios::trunc);
std::atomic flag = false;
auto t1 = std::thread([&](){
outFile
Подробнее здесь: [url]https://stackoverflow.com/questions/79855089/does-the-happen-before-guarantee-the-order-of-delivery-for-data-to-a-file[/url]