CUDA API reference

You can see CUDA APIs' and explanations in the following site.

http://www.clear.rice.edu/comp422/resources/cuda/html/modules.html 
신고
TRACKBACK 0 COMMENT 1

Add a message pumping feature to the WaitForSingleObject API

WaitForSingleObject function is usually used to wait a response of another process or thread. Most common usage is like the following code.

WaitForSingleObject(object, INFINITE);

Although it is really simple and useful, it blocks all messages until the function returned. Therefore, the application using this function acts as if it is an unresponsive applcation like applications that are hangged.

Thus, I added a message pumping feature to the WaitForSingleObject API.
The function assumes that the user uses WaitForSingleObject function with INFINITE parameter. Since it supports the message pumping feature, it allows you to wait until the object signaled with very responsive user interface.

(I know that using thread is much better than this function. However, the problem is that thread is somewhat tedious work and sometimes managing thread just for very short code is quite burden for people)

void WaitForSingleObjectWithMsgPump(HANDLE hHandle)
{
DWORD dwRet;
DWORD dwFailedCnt = 0;
while(1) {
dwRet = WaitForSingleObject(hHandle, 1);
switch( dwRet ) {
case WAIT_TIMEOUT:
// not released - let it go
dwFailedCnt = 0;
break;
case WAIT_ABANDONED:
// released
return ;
break;
case WAIT_OBJECT_0:
// released
return ;
break;
case WAIT_FAILED:
// ? 
// if failed statues are repated over 5 times, 
// consider it as released
dwFailedCnt++;
if( dwFailedCnt > 4 ) {
return ;
}
break;
}

// pump message
PumpMsg();
Sleep(1);
}
}
신고
TRACKBACK 0 COMMENT 0

How to change the background color of static control to transparent

HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if( pDC ) {
pDC->SetBkMode(TRANSPARENT);
return (HBRUSH)GetStockObject(NULL_BRUSH);
}
return hbr;
신고
TRACKBACK 1 COMMENT 0

x86 opcode list

http://ref.x86asm.net/
신고
TRACKBACK 0 Comment 4

Nowadays

1. Analyzing and writing some stubs related to a virtualization.
2. Planning to write articles about migrating legacy software for Windows7
3. Planning a seminar or articles for Visual Studio 2010(migration issues)

Hope we will meet soon in public!
신고
TRACKBACK 0 COMMENT 0