Visual Studio 2003
HANDLE hLogFile;
hLogFile = CreateFile("c:\\log.txt", GENERIC_WRITE,
FILE_SHARE_WRITE, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL);
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_ASSERT, hLogFile);
- Kuling's blog
- Odpowiedz
- 104 odsłony
http://msdn.microsoft.com/en-us/library/k13k85ky.aspx
http://msdn.microsoft.com/en-us/magazine/cc301398.aspx
- Kuling's blog
- Odpowiedz
- 98 odsłon
http://msdn.microsoft.com/en-us/magazine/cc301399.aspx
- Kuling's blog
- 94 odsłony
- Kuling's blog
- Odpowiedz
- 86 odsłon
Can you explain the purpose of the typename keyword in C++? When should I use it instead of <class T>? Is there some difference between the two?
- Kuling's blog
- Odpowiedz
- 101 odsłon
- Kuling's blog
- Odpowiedz
- 92 odsłony
Below you can find three methods of writing exception safe code in real world. In the order prefered by author:
- Petru's ScopeGuard
- RAII
- try / catch mess
http://www.ddj.com/cpp/184403758
- Kuling's blog
- Odpowiedz
- 80 odsłon
It's far easier and much less trouble to find and use a bug-ridden, poorly implemented snippet of code written by a 13 year old blogger on the other side of the world, than it is to find and use the equivalent piece of code, written by your team leader on the other side of a cubicle partition.
- Kuling's blog
- Odpowiedz
- 100 odsłon
- Kuling's blog
- Odpowiedz
- 90 odsłon
When the arrival rate at a lock is consistently high compared to its lock acquisition rate, a lock convoy may result. In the extreme, there are more threads waiting at a lock than can be serviced, leading to a catastrophe. This is more common on server-side programs where certain locks protecting data structures needed by most clients can get unusually hot.
http://msdn.microsoft.com/pl-pl/magazine/cc817398(en-us).aspx
Critical sections as implemented in Microsoft Windows operating systems provide a good example of how lock convoys can occur. In Windows, critical sections use a combination of a spinlock and a kernel synchronization object called an "event" to ensure mutual exclusion. For low-contention critical sections, the spinlock will provide mutual exclusion most of the time, falling back on the event only when a thread fails to acquire the spinlock within a certain amount of time. When contention is high, however, it is possible for many threads to fail to acquire the spinlock and enter a waiting state, all waiting on the same event.
- Kuling's blog
- Odpowiedz
- 101 odsłon
