Author Archives: linhbui

Các kỹ thuật debug memory leak

Có thể tham khảo thêm tài liệu này: https://www.cs.cmu.edu/~guna/15-123S11/Lectures/Lecture06.pdf https://en.wikipedia.org/wiki/Memory_debugger Muốn debug thì lúc biên dịch phải enable debug lên bằng cách thêm option khi compile: ví dụ: g++ -g,… Read more »

[pthread] RWlock

Reader-writer problem https://en.wikipedia.org/wiki/Readers%E2%80%93writers_problem Suppose we have a shared memory area with the basic constraints detailed above. It is possible to protect the shared data behind a mutual exclusion mutex, in… Read more »

[pthread] Spinlock

https://www.bogotobogo.com/cplusplus/multithreading_pthread.php Nhanh chóng chiếm được lock as soon as lock được nhả ra. Tiến trình đợi không ngủ liên tục chờ đợi. Nên dùng spinlock với trường hợp cần nhanh… Read more »

10 question c++

https://tests4geeks.com/cpp-interview-questions/ [Question #1 – Smart Pointer – Standard library] [Question #2 – Rule of Five – RAII] [Question #3 – Finding bugs – Basics] [Question #4 – Automatic objects –… Read more »