Thursday, April 30, 2009

Out of danger

이번주 시작부터 지금까지, 팀 리드가 휴가를 떠나는 바람에
대타로 팀장 업무까지 같이 보고 있는 중이다.

뭐 그건 좋다. 할만해. 영어도 요즘 컨디션이 좋은 지 잘 되는 편이였고.
Technical Director 아저씨도 참 친절하게 잘해주고 팀원들도 잘 따라주니.

그런데 화요일 밤.

이번 스프린트 결과와 향후 진행 방향에 대한 Tech 쪽 회의를
사장님과 같이한다는 meeting arrangement 가 날아왔다.

오우 지져스~

아직 거의 이야기를 나눠본 적이 없는 사장님 앞에서
버벅거리면서 Team Issues 를 전달할 생각을 해보니 이거야 말로 대 위기!

화요일 부터 열씸히 대본 샘플 작성하고 외우고 막 그러고
어제 (수요일) 아침에도 열씸히 준비했다. 그런데!
갑작스런 연기. 목요일로 연기되었다는 메일이 왔다. 사장님의 개인 사정상.

그래서 오늘 목요일. 준비한 스크립트 열씸히 외우고 시간을 초조하게 기다리고 있었는데,
왠걸. 아무말도 없다.
5분이 지난 후.
월요일로 다시한번 연기 되었다는 이메일!!!
월요일에는 팀 리드 복귀. 크핫.
위기에서 벗어나게 되었다.

사실, 위기가 곧 기회라는 말이 있듯이 한 번 제대로 해보고 싶은 마음도 꽤나 있었었는데
뭐 이런식으로 흘러가 버릴 줄이야. 준비 많이 했었는데.
다음에 영어 더 잘해서 훌륭한 모습으로 첫 인상을 심어줘야겠다.

암튼 그래서 위기 탈출~

Thursday, April 23, 2009

Words in the Bourne Identity Novel - 1

discrepancy : 모순, 불일치.
magnitude : 크기, 크고 작음. 중요성.
heave : (무거운 것을) 들어올리다.
stump : 그루터기, 잘리고 남은 부분, 의족.
obscene : 외설한, 음란한.
cripple : 신체장애자, 불구자, 병신으로 만들다, 무능력하게 하다.
comrade : 동료, 동지, 전우.
meagerly : 메마르게, 무미건조하게.
ravage : 파괴, 파괴하다.
contort : 잡아비틀다, (얼굴이) 일그러지다.
rug : (방바닥에 까는) 장판, 융단.
corpse : 시체, 송장.
deform : 추하게 하다, 볼품없게 하다.
coffin : 관, 널, 판상.
erupt : 분출하다, 폭발하다, 발진하다.
elongate : 연장하다, 늘이다.
wail : 울부짖다, 소리내어 울다, 통곡하다.
revulsion : 극도의 불쾌감, 혐오감.
conduit : 도관, 수도, 전선관.
basin : 대야, 웅덩이, 분지.
hinge : 경첩, 힌지 (파라핀 종이, 침에 녹는 끈적한 거), 우표를 붙이다.
shatter : 산산이 부수다, 분쇄하다, 파편.
gauze : 거즈!!! 얇은 천 그거말하는 거임.
plaster : 회반죽, 벽토, 가루석고, 회반죽을 바르다, 빈틈없이 메우다.
propel : 추진하다, 앞으로 나아가다. .... 그동안 프로펠러만 알았던 내가 한심하다 -_-;
unravel : (얽힌 실을) 풀다, 해명하다.
blot : 얼룩, 때, 흠, 오점, 더럽히다, 오점을 남기다, 잉크가 번지다.
trickle : (액체가) 뚝뚝 떨어지다. 졸졸흐르다, 눈물을 흘리다.
dizzy : 현기증이 나는.
spill : 엎지르다, 흩뜨리다, 피를 흘리다.
plead : 변호하다, 반론하다, 변명하다.
conservative : 보수적인, 보수적인 사람.
pint : 파인트. 액체의 단위. (영-0.57 리터, 미-0.47리터)
compartment : 구획, 칸막이.
squint : 사팔눈의, 사시의, 사팔눈, 곁눈질을 하다.
dim : 어둑한, 흐릿한.
substantial : 상당한, 실체의, 튼튼한.
surreptitiously : 비밀의, 비밀리에, 몰래, 부정하게.
immobilize : 움직이지 못하게 하다, 고정시키다.
deliberately : 신중히, 고의로, 차분히.
slovenly : 단정치 못한, 부주의한.
sag : 가라앉다, 꺼지다, 느슨해지다, 약해지다, 늘어짐, 하락.
kerb : (영) = curb. 재갈, 고삐, 구속, 재갈을 물리다.
shudder : (추위, 공포에) 떨다, 떨림.
paralyze : 마비시키다, 무력하게하다.
wear / wearily : 피고한, 싫증이 난, 지루한, 따분한.
ease : 편함, 마음이 편함, 진정시키다, 안심하다, 편해지다.
incoherent : 조리가 맞지 않는, 일관되지 않는.
expendable : 소비되는, 소모성의.
intermittent : 때때로 중단되는, 간헐성의.
interrogation : 질문, 심문, 의문.
confront : 직면하다, 맞서다.
rundown : 병든, 황폐한, 또는 감원, 감군.
mill : 제조공장, 제작소, 분쇄기, 압착기(과일즙짜기)


아.. 단어 진짜 어렵네 -_-;
책을 읽으면서 모르는 단어에 빨간줄 긋고 있는 중인데,
죄다 빨간색. 아 놔.
위의 단어들이 겨우 6쪽에서 나온 것 들.

뭐.. 차차 좋아지겄지.

Wednesday, April 22, 2009

Paged, nonpaged pool

So far, Paged pool and NonPaged pool are one of important issues to server programmers.
Here is a very good article. It's a latest version.
That means the content is slightly different from the content in the 'Network Programming Windows 2E' book.
Therefore, we need to read this article.

In my opinion, the Key Point in this article is we don't need to consider about paged / nonpaged pool any more if you use Windows7 and lots of memory.
The paged / nonpaged pool are also gratefully increasing on Windows7.
Of course, there is a limitation. But, it's too big size in the current environment.
It's possible to be changed the environment in the future.

Anyway, we can reduce a crucial thing we have to consider.



.Net framework for Linux

Mono.

I'm not sure whether this project is really useful or not.
I don't think there are many programmers who use .Net framework in linux.

But, .Net framework is very powerful, reliable and soft.
This project is a challenge. 
There are brave programmers who like a challenge.
They will prove it is useful or not. :)

NedMalloc & Hoard

NedMalloc.
http://nedprod.com/programs/portable/nedmalloc/index.html
http://sourceforge.net/projects/nedmalloc

Hoard.
http://www.hoard.org/


NedMalloc is an upgrade version of DLMalloc.
It has thread pools and memory caches in each thread.
It patches DLMalloc's weakness point in multi threads environment.

Hoard is one of the fastest memory allocators.
I heard it is used in lots of softwares.

NedMalloc is free. Its license is following a BSD and Boost license.
Hoard is not free if you use it for commercial software.


However, a decision depends on your choice. :)

Monday, April 20, 2009

Me





Me in Langkawi.

QueryPerformanceTimer

Whenever I try to use a high resolution timer,
I have written source codes down everytime.

This post is to save it. Back up. :)


#include windows.h

class QueryPerformanceTimer
{
public:
QueryPerformanceTimer() : timer_frequency_(0)
{
init();
}
virtual ~QueryPerformanceTimer() {;}

void init()
{
if (QueryPerformanceFrequency(&frequency_))
{
//printf("High:%d, Quad:%d, Low:%d\n", frequency_.HighPart, frequency_.QuadPart, frequency_.LowPart);
timer_frequency_ = (double)((long double)(frequency_.HighPart >> 32) + frequency_.LowPart);
}
else
printf("QueryPerformanceFrequency returned FAIL\n");
}

void start()
{
if (timer_frequency_ == 0)
return;

QueryPerformanceCounter(&initial_);
}

void stop()
{
if (timer_frequency_ == 0)
return;

QueryPerformanceCounter(&counter_);
}

double elapsed()
{
if (timer_frequency_ == 0)
return 0;

double elapsed = (double)((long double)(counter_.QuadPart - initial_.QuadPart) / (long double)frequency_.QuadPart);
return elapsed;
}

bool is_valid()
{
return timer_frequency_ != 0;
}

double timer_frequency()
{
return timer_frequency_;
}

private:
LARGE_INTEGER initial_;
LARGE_INTEGER frequency_;
LARGE_INTEGER counter_;

double timer_frequency_;
};


This code is very weak against exceptions. But it's okay if you use it simply.
Copy & Paste!!!

Benchmark of memory allocators.

I did a benchmark test of memroy allocators.
Standard allocator, DLMalloc, LFH.
(The standard allocator is 'std::malloc' and 'std::free').

I did the test with various environment.
Fortunately, the one image can show the result. (Of course, my original document has lots of results.)


Number of threads : 4
Block size : 128
Number of allocations : 2,000,000

CPU : Intel Core2 Quad Q6700 @2.66GHz
OS : Windows Vista
RAM : 4GB

Summary : LFH is the best.

Low-fragmentation heap

Low-fragmentations heap.

Heap fragmentation is when available memory is broken into small, non-contiguous blocks. When this occurs, memory allocation can fail even though there is enough memory in the heap to satisfy the request, because no one block of memory is large enough to satisfy the allocation request.

For applications that have a low memory usage, the standard heap is adequate; allocations will not fail due to heap fragmentation. However, if the application allocates memory frequently and uses a variety of allocation sizes, memory allocation can fail due to heap fragmentation.

Windows XP and Windows Server 2003 introduce the low-fragmentation heap (LFH). This mechanism is built on top of the existing heap, but as the name implies, it reduces fragmentation of the heap. Applications that allocate large amounts of memory in various allocation sizes should use the LFH. Note that the LFH can allocate blocks up to 16 KB. For blocks greater than this, the LFH uses the standard heap.

- MSDN

------------------------------------------------------

We can use it very easily, but it's powerful.

The only remind thing is...
This feature works on Windows XP and Window 2003 server and higher.


Friday, April 17, 2009

DLMalloc


A customized memory allocator for multi platform.
(malloc / calloc / realloc / free)

I've look into it, and then I feel its a good memory allocator.
It has flexible features even keeping its good performance.
We can produce several important options.
- Memory pooling, Threshold setting, Lock mechanism for a multi threading, and more...