Conversation
ziobron
left a comment
There was a problem hiding this comment.
Cząstkowe review dla index.pl.html, 00_intro.pl.md, 01_busy_waiting.pl.md i 02_condition_variable.pl.me
Reszta później :)
|
|
||
| ### Zmienna warunku (condition variable) | ||
|
|
||
| * <!-- .element: class="fragment fade-in" --> <code>#include <condition_variable></code> |
There was a problem hiding this comment.
| * <!-- .element: class="fragment fade-in" --> <code>#include <condition_variable></code> | |
| * <!-- .element: class="fragment fade-in" --> <code>#include <condition_variable></code> |
Nie wyświetla zawartości w <>, bo uznaje to za tag html
ziobron
left a comment
There was a problem hiding this comment.
Reszta sprawdzona. Ze zmian, których nie zaznaczyłem to trzeba będzie zmniejszyć poziom wszystkich nagłówków, bo wszędzie pierwsze slajdy pozmieniałem, aby tam był tylko nagłówek pierwszego poziomu.
| # Multithreading | ||
|
|
||
| ## Moduł 4 | ||
|
|
||
| ### Model pamięci C++ |
There was a problem hiding this comment.
| # Multithreading | |
| ## Moduł 4 | |
| ### Model pamięci C++ | |
| # Model pamięci C++ |
|
|
||
| ___ | ||
|
|
||
| ### Model pamięci C++ |
There was a problem hiding this comment.
Jakby co to ta część z modelu pamięci chyba była już tłumaczona w module 2. Można po prostu ją przerzucić.
| ```bash | ||
| $> g++ 01_stop.cpp -lpthread -fsanitize=thread | ||
| $> ./a.out | ||
| WARNING: ThreadSanitizer: data race (pid=10179) | ||
| ... | ||
| $> g++ 01_stop.cpp -lpthread -fsanitize=thread -03 | ||
| $> ./a.out | ||
| deadlock | ||
| ``` |
There was a problem hiding this comment.
ten fragment bym sugerował dać na całą szerokość już pod kodem i obrazkiem
| ```bash | ||
| $> g++ 01b_volatile.cpp -lpthread -fsanitize=thread | ||
| $> ./a.out | ||
| WARNING: ThreadSanitizer: data race (pid=10179) | ||
| ... | ||
| $> g++ 01b_volatile.cpp -lpthread -fsanitize=thread -03 | ||
| $> ./a.out | ||
| WARNING: ThreadSanitizer: data race (pid=10179) | ||
| ... | ||
| ``` |
There was a problem hiding this comment.
To również na całą szerokość
| <img height="400px" data-src="img/perfect.jpeg" alt="perfect" class="plain"> | ||
| <!-- .element: class="fragment fade-in" --> |
| ### Przykład: thread-safe Singleton | ||
|
|
||
| ```c++ | ||
| class Singleton { | ||
| static std::unique_ptr<Singleton> instance_; | ||
| static std::once_flag flag_; | ||
| Singleton() = default; | ||
| public: | ||
| static Singleton& getInstance() { | ||
| std::call_once(flag_, [&] { | ||
| instance_.reset(new Singleton{}); | ||
| }); | ||
| return *instance_; | ||
| } | ||
| }; | ||
| ``` | ||
| <!-- .element: class="fragment fade-in" --> | ||
|
|
||
| * <!-- .element: class="fragment fade-in" --> Wolne (once_flag) | ||
| * <!-- .element: class="fragment fade-in" --> Bezpieczne | ||
| * <!-- .element: class="fragment fade-in" --> <strike>Trochę mniej kodu</strike> |
There was a problem hiding this comment.
To jest to samo co na slajdzie z linii 42 - do wywalenia
| # Multithreading | ||
|
|
||
| ## Moduł 4 | ||
|
|
||
| ### Wyjątki w call_once |
There was a problem hiding this comment.
| # Multithreading | |
| ## Moduł 4 | |
| ### Wyjątki w call_once | |
| # Wyjątki w call_once |
|
|
||
| <div style="width: 44%;"> | ||
|
|
||
| <div style="background-color: #8B3536; padding: 5px 10px;"> |
There was a problem hiding this comment.
| <div style="background-color: #8B3536; padding: 5px 10px;"> | |
| <div style="padding: 20px;"> |
|
Po tych zmianach można śmiało tłumaczyć na angielski. atomic został już przetłumaczony w module 2, ale możliwe że nie cały. Warto skorzystać z gotowca. |
Co-authored-by: Łukasz Ziobroń <lukasz@coders.school>
ziobron
left a comment
There was a problem hiding this comment.
Wygląda dobrze :) małe drobiazgi z niektórymi tłumaczeniami już na masterze zmienię. Dzięki!
| << sleepDuration << "ms\n"; | ||
| cout << msg.str(); | ||
|
|
||
| this_thread::sleep_for(chrono::milliseconds(sleepDuration) |
No description provided.