ݺߣ

ݺߣShare a Scribd company logo
어플 개발자의
서버개발 삽질기



2011 아.꿈.사 연말 세미나
     발표 : 김연기
발표자 소개
• 이름 : 김연기
  – @scor7910
  – http://scor7910.tistory.com
• 2008.10 ~ 2011.10 Microsoft Visual
  C++ MVP
• 2007~2011/03 : Visual C++ 로 이런저런
                 어플 개발
• 2011/05 : 네시삼십삼분에서 서버 플랫폼
  개발 삽질 시작…
Game4U Platform
Game4U Platform
Game4U Platform
Game4U Platform
Game4U Platform
왜 삽질을 했는가?
  • 플랫폼 아키텍처 이해 부족.
  • 경험 부족.
   – Boost::asio
   – WEB
   – Database
Boost::asio
•   멀티쓰레드 I/O 조심!!
    – 외부 쓰레드에서 소켓핸들의 close/write는 Io_service::post를 사용.
       • template< typename CompletionHandler> void
         post( CompletionHandler handler);
•   종료는 우아하게(Graceful closure)
•
Dead Lock
Dead Lock
const BOOL& CAxisOfDevil::DoSomething()
{
        EnterCriticalSection(&m_CS);
        UINT i=0;

        while(1)
        {
                   ++i;
                   if(i==1000)
                   {
                            Sleep(10);
                            return FALSE;
                   }
        }
        LeaveCriticalSection(&m_CS);
        return TRUE;
}
Dead Lock
const BOOL& CAxisOfDevil::DoSomething()
{
        EnterCriticalSection(&m_CS);
        UINT i=0;

        while(1)
        {
                   ++i;
                   if(i==1000)
                   {
                            Sleep(10);
                            return FALSE;
                   }
        }
        LeaveCriticalSection(&m_CS);
        return TRUE;
}
DUMP Analysis
• !analyze –v –hang
• Kn , .frame, dv, dt
• !for_each_frame dv /i /t /V
03 0532fdc8 00414834 mtgdi!CBallThread::SingleStep+0x147
[c:downloadsmtgdithreads.cpp @ 180]
prv local 0532fdc4 @ebp-0x04 class CBallThread * this = 0x043349f0
________________
04 0532fe20 00414d8c mtgdi!CGDIThread::InitInstance+0x44
[c:downloadsmtgdithreads.cpp @ 65]
prv local 0532fe1c @ebp-0x04 class CGDIThread * this = 0x043349f0
DUMP Analysis
• ProcDump
  – Procdump –ma –t –e <process name>
  – http://technet.microsoft.com/ko-
    kr/sysinternals/dd996900(en-us).aspx
Googleing




– 내가 격고 있는 문제는 대부분 누군가 격은
  문제.
– 단어 조합을 잘 하자 힠~
 • 영어와 친하게 지내요~
     – Google 미쿡을 기본 검색 페이지로~~
 • Error/Exception 코드 + when + …
WEB
• Try / catch 는 무의식적으로…
• Application Log를 보자!
HTML 5
• 안드로이드는 무조건 안된다고 보자.. @,.@
• C++에 Boost가 있다면, 웹엔 Jquery??
• 모바일 플랫폼에서 적용 가능한지 검증이 중요!
Communication
  나는 괶댶다.
Communication
나의 마음은 바다와 같이 넓고 깊어요.
Communication
문제 해결을 위해서 라면…
참고자료
•http://blogs.msdn.com/b/ntdebugging/archive/2008/06/06/wi
ndbg-tip-kn-frame-dv-and-dt-it-s-so-easy.aspx
•http://blogs.msdn.com/b/debuggingtoolbox/archive/2009/08
/20/special-command-using-for-each-frame-to-run-
commands.aspx
2012년엔 꿈과 희망이…
2012년엔 꿈과 희망이…



    Q&A

More Related Content

어플 개발자의 서버개발 삽질기