Thursday, September 16, 2010

Stack overflow 시 minidump

http://sweeper.egloos.com/2420307

지금 현재 프로젝트에서 google-breakpad 를 쓰고 있는데,

얘도 위의 것과 비슷한 원리로 덤프를 남기고 있다.

위의 링크에서는, stack overflow 발생시 thread 를 하나 생성해서 덤프를 찍는 방법을 쓰고,

google-breakpad 같은 경우는 이미 시작부터 dump 용 thread 를 만들어서 그 thread 가 주가 되어서 dump 를 남긴다.

배현직님 께서 카페에 쓰신 글 중, dump 안남고 죽는 경우.
3가지 정도로 기억합니다. Pure virtual function. CRT check. Stack overflow. 앞 둘은 핸들러 루틴 오버라이드로 해결되며 뒷것은 타 스레드에서덤프남기기 혹은 sp레지스터 변경하기로 해결돼요.

CRT check 는 안걸려봐서 모르겠지만,

Pure virtual function 과 stack overflow 는 google-breakpad 로 dump 남기는 걸 확인했음.

Tuesday, September 14, 2010

A current trend in programming (2010)

요즘에 느끼는 프로그래밍 관련 트렌드는 - '멀티코어' 에서 성능이 잘 나오는 프로그램을 만들자. - 인 거 같다.
I feel something that the current trend in programming is to write a good code for better performance in multi core CPU.

물론, 멀티코어는 아주 오래전 부터 있던 거니깐... 막 요즘의 트렌드라고 할 수는 없겠지.
Of course, this is not a new trend. The multi core CPUs were already used very long time ago.

내가 처음 서버 개발에 뛰어 들었던 2001 년에도, 우리 서버 Dell 머신은 CPU 가 4 개 였었지.
When I started a server programming in 2001, our server machine - DELL - had 4 CPUs.

아키텍쳐는 현재의 하나의 Unit 에 N 개의 코어가 달린 것과는 완전 다른 것이지만.
The architecture is totally different from current CPUs which have N-cores in one unit.

여튼 오래된 이슈임에는 틀림없다.
Anyway, that's pretty old issue.


그 때의 나는 완전 생초보였고, 그냥 프로그래밍 하기도 힘들어 죽겠는데
멀티코어는 나의 능력을 벗어나는 부분이었다.
I was a very beginner in programming at that time so that I couldn't have enough skill for multi core programming.

비록, 멀티쓰레드 프로그래밍을 하긴 했지만, 그건 어디까지나 쓰레드 프로그래밍.
Even though I programmed in multi threading environment, that was in application level thread programming. 

내부를 많이 뜯어보지 않고 Application 단에서 쓰레드를 돌리는 그런 수준의 프로그래밍이었지.
I didn't take a look deeply into the core level.


헌데 언제부터냐... 2007년 쯤 인 듯.
By the way, a someday in 2007.

GDC 세션 중에서 GPU 로 프로그래밍 하는 부분을 보고 깜짝 놀랬던 기억이있다.
I was surprised by a GPU programming session in GDC.

어셈블리 짜듯이 뭔가 복잡해 보이는 instruction 들로 코딩을 하는...
It just looked like assembly which has a lot of complex instruction for programming.

그때는 그냥 아 뭐 저렇게 힘들게 굳이 코딩을 해야 하나 라는 생각을 하고 넘어갔었는데,
I couldn't have any good reason to use the difficult instructions at that time.

이미 그 때에 CPU 와 GPU 를 조금 더 가깝게 활용하는 프로그래밍이, 새로운 트렌드가 될 거라는 느낌을 받았지만,
애써 외면해왔었다. '굳이 꼭 해야하느냐' 라는 생각이 컸었기 때문에.
I thought we do not need a sort of complex coding even though I got a feeling that it would become a new trend to use CPU and GPU in direct way.


그 후로 몇 년동안의 프로그래밍 이슈 중 하나 컸던 게 있었다면
- Lock 을 최대한 줄이자 - 이었던 거 같다.
For last a couple of years, one big programing issue was that reduce 'lock' as possible.

Lock 을 하면서 발생하는 여러가지 부수적인 성능저하 요인 때문에, 코어가 아무리 늘어나고 늘어나도 프로그램의 성능이 전혀 나아지지 않기 때문이다.
That is because there are lot of facts which couldn't give a good performance even though an application uses lots of threads, and a machine has multi core cpu.

LockFree 알고리즘을 시작으로, Lock 을 최대한 피하는 구조, Lock 없는 병렬처리 늘리기 등등.
So, we got a couple of new trends that Lock-Free algorithms, avoiding lock architectures, parallel processing without locking and more.

그런데 이런 식의 접근 방법은, 생각보다 내포되어 있는 문제가 꽤나 많고,
(Compiler 의 명령어 재배치, Lock Free 의 Hazard Pointer, 무한루프. 제한적인 Thread 사용을 하게 되는 OpenMP. 여러 제약이 있는 TBB 의 Concurrency)
However, these approaches have a couple of problems.
(Instruction reorder by compiler optimizations, Hazard pointer and infinite loop in Lock free, limited threading of openMP and lots of restriction in TBB concurrency algorithm)

프로그래밍 할 때 신경써야 할 부분이 너무나도 많은 데다가,
그렇다고 또 획기적인 성능 향상이 이루어 지는 것도 아니었다.
There are too many concerns in writing codes even though it can't give a pretty better performance.


이러다 보니, 다시 재조명 받게 된 것이 차라리 CPU 를 직접적으로 활용하자 인 듯.
So now, the old trend comes again. Using CPU instruction more and directly.

CPU 가 더 빠르게 연산을 처리할 수 있도록 자료구조, Align 도 맞추고,
Cache 적중율을 높이기 위한 작업도 해주고,
CPU 별로 가지고 있는 확장 명령어도 써주고,
(A well designed data structure for better cpu operations, aligns, make cache hit more and use extension instruction in CPUs)

사실 위에 언급한 부분들은, 386, 486, Pentium 시절에 많은 프로그래머들이 고민했었던 이슈인 거다. (물론, 난 그때 프로그래밍 할 줄 몰랐음.)
It is actually techniques which were used for 386, 486 and Pentium CPUs. And a lot of programmers had thought and used it long time ago. (Of course, I didn't know a programming at that time.)

지금 시대에선, 이 모든 것들을 멀티코어에 맞게끔 짜주어야 한다는 게 더해진 거지.
It comes again with a big issue - multi core.

게다가, GPU 까지 써가면서 프로그래밍을 해야할 상황이 눈 앞에 온 거 같다.
In addition, we are about to use GPU programming as well.

물론, 이렇게까지 하지 않아도 프로그램은 잘 돌아갈테지만. :)
I'm sure that an application will work very fine even though programmers don't use those techniques for their applications.

얼마전 어디서 살펴본 Programming Quiz 에서도 이 쪽에 관련된 부분이 꽤나 등장했었고
However, it's obviously a new trend that we definitely need to know. (If we use C/C++)

요새 출간되는 책만 살펴봐도 이 쪽 관련된 책이 많이 출간이 되고 있다.
There are a couple books released which explain it.

그간 애써 모른척하고 있었지만, 이제는 발벗고 나서서 알아야 할 듯. ㅋ
I have tried to avoid this LoL, but, I can't do it any more. I need to study right now.



+ 역시 아무생각없이 짤 수 있는 C# 이 최고인건가.
+ That's why I like C#. It makes my brain empty.


짧게 쓰려고 했었는데 다 쓰고 나니 엄청 길군 -_-;

Thursday, August 26, 2010

Inception


이 영화를 싱가폴에서 한번, 한국에서 한번 이렇게 두 번 봤다.
I watched this movie twice, the first in Singapore and the second in South Korea.

개봉하자마자 너무 보고 싶어서 걍 영어로 봤었지만,
I really wanted to watch it asap so I did it in English speaking,

도저히 이해가 안되서 -_-; (저주 받은 듣기 능력 때메 반 정도 밖에 못 알아들었다.)
But, I hardly understood it. (because of my poor English hearing skill.)

그래서 한국에서 다시 보고 96% 정도 이해 완료.
So, I watched it again in South Korea and then I got to understand it over 96%.

정말 잘 만든 영화다. 난 이렇게 허구이지만 나름 논리를 '갖추려고 노력하는' 영화들을 매우 좋아한다.
Very very good movie. I like this sort of style movies very much which is unreal but has a solid logical plot.

이 영화는 그 '논리적' 인 면에서 매우 훌륭하기 때문에 정말 인상깊었다.
This movie's plot is very very logical and complex. So I like it. Impressive.

DVD 나오면 구입 예정. 후후후.
I'll buy its DVD when it released. Huhu.


포스터는 점점 대세로 떠오르는 조셉 고든 래빗.
The man in the picture is Joseph Gorden-Levitt who is becoming a big big star.

Tuesday, August 17, 2010

Airline, Korean vs Asiana

이 글은 느낌을 살리기 위해서 한글로만 씀. 쏘리 쏘리.
This post is written in Korean only to make it more fun. Sorry my friends.

이번 한국 휴가에서 한국을 대표하는 두개의 항공사를 모두 이용할 수 있는 기회를 가졌다.

그래서 이번에 받은 느낌을 한번 적어보려고 한다.

절대적으로 주관적인 견해이고 웃자고 하는 얘기이니, 걍 웃으면서 봐주시길.


- 비행기 + 시설 : 큰 차이는 없음. 둘 다 모두 좋은 비행기, 안좋은 비행기가 있기 때문에.. 고르기 나름.

- 개인 액정 + 소프트웨어 : 대한항공 승리. 아시아나도 분발했지만, 편의성에서 밀렸음.
예를 들자면, 노래를 틀어놓고 다른 걸 할 수 있는가 없는가의 차이.

- 승무원 구성 : 아시아나 승. 아시아나는 모두 스튜어디스다. 대한항공엔 스튜어드가 있다. 이런 샹!

- 승무원 외모 : ㅋㅋㅋ 대한항공의 압도적인 승리. 대한항공은 면접볼 때 외모 지수가 50% 넘을듯.

- 승무원 서비스 : 둘 다 매우 훌륭.

- 기내식 : 간발의 차이로 아시아나 승. 비빕밥에 같이 주는 국이 북어국이었다. 대한항공은 미역국. 난 북어국을 좋아하니 ㅋㅋ. 비빕밥의 품질은 둘다 매우 훌륭!

- 와인 : 아시아나 승. 나에겐 좀 더 맛이 좋았다.

- 맥주 : 대한항공 승. 대한항공은 여러가지의 맥주를 선택할 수 있던 반면, 아시아나는 달랑 카스!!! 이런 샹. 아니면 나만 카스를 준건가!

- 기내 면세품 : 타는 날짜가 좀 달라서 일지도 모르겠지만, 아시아나가 좀 더 쌌음. 면세품의 종류는 큰 차이는 없었음.

- 가격 : 서비스의 차이가 사실 거의 없는 상황인데, 대한항공이 너무 비쌈...


뭐 이정도. ㅋㅋ 기타 자질구레 한 것들은 대동소이 하기 때메 패스.

개인적으론 가격이 저렴한 아시아나를 선호. (그런데 마일리지는 대한항공이 훨씬 많음. 꽥)

Friday, August 13, 2010

Exhibition - A stranger, Bird

http://www.youtube.com/watch?v=LiEnuSln5u0



전람회 2집 - 이방인 1994.
Exhibition 2 - A stranger.

요즘 나의 기분과 맞는 노래랄까. 역시 명곡은 죽지 않는다.
It gives me lots of feeling these days again.
A good song never dies.






그리고 이건 같은 앨범에 수록되었던 새.
This song name is 'Bird' which was in the same album.

http://www.youtube.com/watch#!v=_pifbjois24&feature=related



역시 명곡은 죽지 않는다.

Monday, August 9, 2010

Beginning 2days of Korea travel

초반 2일 이야기.
2 days in Korea.

- 한국 너무 덥다. 이건 뭐 거의 싱가폴과 맞먹는 날씨.
- It's too hot, crazy. The temperature is almost same to Singapore's one.

- 지하철 역사 미친듯이 덥다. 왜 그 곳에는 에어컨을 안트는거냐!
- It's too hot even at a subway station. Why don't they use an air-conditioner?

- 큰 일 하나 마무리 해서 기분이 좋았다. 하지만 현대증권 제발 지점 좀 늘려줘.
- I've completed a very significant thing (one of the reasons of this traveling).
- That's good.

- 내일 큰 일 하나 더. 일찍 일어나야 하는데... 아 쉽지 않겠어.
- But, I have one more important issue at tomorrow morning. That might be difficult.

- 먹은 거 : 삼각김밥, 육개장, 살치살, 갈비, 복분자주, 떡만두국, 열무냉면, 고등어구이, 아 무슨 전복 친구로 만든 된장찌개.
- I have eaten a couple of Korean foods~~

- 인셉션 한글 자막으로 다시 봤다. 최고야. 근데 이걸 영어로 자막없이 도전했던 건 정말 무모했었다.
- I watched 'Inception' again with Korean subtitles. What an excellent movie!
- I realized that was a too big challenge for me to watch it in English (no subtitles).

- 좋지만 쓸쓸한 이 기분. 열씸히 했지만, 쓸쓸한 건 가시질 않는다. 계속 이방인.
- I felt alone still. I did my best, but still have felt alone. Feeling lonely too much... I felt that I couldn't get into the mind.

Wednesday, August 4, 2010

Nasi & Mi Goreng at Golden Cafe


22nd July

My favorites in Indonesia food.
Nasi means a rice, Mi means a noodle. Goreng means fried. (Thanks Loon Chew)

The Golden Cafe is just near my office.
I like the stall because it has a couple of good food. And the price is reasonable.
(But, too many oils. In most cases, I need a bottle of coke after this.)

Tra Pizza at Sentosa


22nd July
A pasta... I forgot the name. :-), but it was good.



A pizza... I forgot this name, too. haha.
This pizza was too simple. I prefer a big and heavy pizza which has a lot of toppings.
Wooooh~


Tuesday, August 3, 2010

A chili crab at Long Beach, East Coast


A chili crab at Long Beach restaurant, East Coast. (21st July)

It's not in strong red. But, it's more spicy than Jumbo's one at Clarke Quay.

Good.