Tag Archives: Windows API

A custom EVENT object for lighting fast thread synchronization

Several weeks ago, while I was working on the next version of Horodruin, I was optimizing the multithreaded file copy engine. This optimization phase pops up an unexpected event on the standard event object processing.  It seems that frequent uses of SetEvent() API are not exactly processing-resources free. This is probably caused by some code overhead needed for a system object… During these evaluations, I … Continue reading A custom EVENT object for lighting fast thread synchronization »

HOWTO Make Windows SlimRW Lock More Confortable

Recently I tripped into SlimRW Lock API. It’s a Windows synchronization object very similar to the critical section, with the support of two different types of lock: shared and exclusive. Essentially you should get the shared lock for all read-only activities, while the exclusive lock shall be used for all the other cases. The Basic Implementation I wrote this simple class to include them in … Continue reading HOWTO Make Windows SlimRW Lock More Confortable »

HOWTO Automatically Catch Problems While Debugging

Suppose to have the ability to add dozens of breakpoints into your program main error detection points, whenever you start a debugging session. This should allow you to easily track down some hidden/unnoticed problems. For example, suppose to have a C function like the below one: __MYOBJECTDATA * WINAPI MYOBJGetPtr (HANDLE hMyObject) { __MYOBJECTDATA *pObj; pObj = (__MYOBJECTDATA *) hMyObject; __try { if ((pObj != … Continue reading HOWTO Automatically Catch Problems While Debugging »