Showing posts with label Multi-core. Show all posts
Showing posts with label Multi-core. Show all posts

Monday, April 14, 2008

Parallel programming for multi-core CPU

I've finished reading this book. The book is sold in only Japanese, is written by FIXSTARS that is famous company about CELL programming, and explains how to start parallel programming with pthread and Wind32 thread API for the beginner. A little explanation about OpenMP and CELL is at the back of the book.

The book teaches data parallel, task parallel and pipe-line parallel to us though sample source code. Even if you have forgotten about pthread, you can recollect all. But, because Mac OS X doesn't implement sem_init(), it is impossible to practice a sample program about semaphore. However, these days, condition variable of pthread is used instead of semaphore, so that's no problem.

P.S.
This book is sold in only Japan. In addition, the world have many books that may be better than this book. But, I tried to write this entry to keep same content of my two blog if at all possible.

Friday, April 11, 2008

The free lunch is over

Do you know why programers keep efforts to learn parallel processing architecture? There was a turning point. Mr. Herb Sutter who is Software Architect of Microsoft expressed developers' job as "man eating free lunch". The impact of his message was explained simply in an article "PC Watch - The decisive tide to the heterozinnias multi-core":

This is represented by the message "free lunch is over" that became famous in 2005 in U.S.A. The message is that Mr. Herb Sutter who is Software Architect of Microsoft has begun to say in columns.

CPU had aimed to enhance the performance of single core heretofore. It means free lunch for software. The only thing that the software does was eating a performance that CPU increases.

However, the situation has changed because a CPU vendor turned to multi-core. The single thread performance of the general-purpose CPU core does not suddenly improve under the present conditions. On the other hand, multi-thread performance suddenly rises by multi-core. Therefore, software developers have to change the software side drastically to parallel processing architecture, if they try to use the performance of CPU.


"The Free Lunch Is Over" showed a new way to many engineers. Our (programers') job had gotten easy from year to year, because the performance of CPU had been rising. While it was possible to improve the single core, programers didn't need to do something. However, it became impossible to improve the single core, so programers have to strive to acquire multi-core programing. New era unfolded.

Even if you have experience to write full or inline assembly for the performance old time, you don't need to imagine assembly programing again, because assembly is not effective for modern CPU. Those CPU has long long pipeline, so it's impossible that human being optimize program in assembly. Programers have to write programs in C and tweak compile-options for performance tuning. This situation makes us feel less stressed.

C keeps the position as the best effective language for multi-core programing for the duration. And, C++ is a good language to develop games productively. It seems that C# may go away from game development situation.

Saturday, March 22, 2008

PowerPC Personal Computer

All major game consoles take PowerPC class. There are many special technics to write high-performance code on PowerPC. In holidays, we were able to try it with ApplePC, but that's old story. Because ApplePC changed from PowerPC to Intel, there are not reasonable PCs to practice in PowerPC programing at home now. How can I try PowerPC and multi-core programing in home?

There are old mac mini, latest iMac and PLAYSTATION3 in my home.

My old mac-mini is not multi core, but that's valuable for me, because the mac-mini is small, light and good to enjoy PowerPC programing.

The current my PC, iMac is dual core and good to practice in multi-core programing. However, intel core duo is not taken by major game consoles. Therefore, I can practice in pure multi-core programing, but that's not useful directly for my job.

PLAYSTATION3 may be useful. It's possible to install Linux and practice in heterogeneous muliti-core programing. Of course, heavy linux environment is inconvenient to program, than PS3 SDK, but there is no chose, because standard PCs don't have heterogeneous multi-core. Fortunately, we can get all of tool-chain of PS3 except specialized libraries like SPURS.

PowerPC multi-core PCs like Power Mac G5 are valuable very much in retrospect.

Working hours are not enough to research multi-core programing. I should have researched more in R&D status. Now, our team had completed R&D and began developing a product. That's good. But, I want time for more trial and error. My PCs are valuable a little for that.

Many expert developers got ways in multi-core parallel processing in games. I don't arrive at such stages, yet.