Monday, August 24, 2009

Games for Windows Live.

Okay, I'm not going to tell you how bad it is since there are many articles about it. If you have nerver heard about its notorious features, check it out.

This was meant to be a Fallout 3 DLC review. or
Fallout 3 New Content, Adventures In GFWL

From those articles, I can easily imagine that user expereicens from GFWL are horrilbe, shameful and pity.

Actually, as a developer, I was okay with GFWL until I needed to deal with bugs from its newly updated 3.0 version. It's okay since debugging is just one of daily tasks we are doing.

However, I'd like to remember the lesson I learned from this experience.
Don't use an outside technology if its provider just distributes a new version and forces users to use it wihtout telling a single word to partner developers.
That's it.

Sunday, August 16, 2009

Network Programming with IOCP and Thread Pool - Intro

These days, I'm playing with network programming with IOCP and Thread Pool just for pure fun. :) After several days of reading MSDN, articles and writing experimental codes, I've realized that there are pretty big changes I need to catch up.

If you still use IOCP with GetQueuedCompletionStatus() and your custom threads (like me before), you might want to follow this series of postings I will update. I will provide sample code to clarify the right way to use them.

Also, I will benchmark techniques to each other so that hopefully I can give you some guidelines about When we need to use Which technique, or, at least, help you to avoid making the same mistakes I would make while I write this series.


First of all, let's see how many ways we can choose for using IOCP.

If we use custom threads to get I/O completion notification,

1. CreateIoCompletionPort() and GetQueuedCompletionStatus()

- Windows 2000 (Pro, Server) or later.

2. CreateIoCompletionPort() and GetQueuedCompletionStatusEx()
- Windows Vista and Server 2008 or later.



If we use Windows Thread Pool to get I/O completion notification,

3. BindIoCompletionCallback()

- Windows 2000 (Pro, Server) or later.

4. CreateThreadpoolIo(), StartThreadpoolIo() and etc

- Windows Vista and Server 2008 or later.

There also some APIs related to Thread Pool like QueueUserWorkItem(). Unfortunately but in a good way, Thread Pool system has been completely re-written for Windows Vista and we need to use those new and richer APIs to maximize our server performance.

If it's not confusing enough, I can tell you that there are also special socket functions which are Microsoft-specific extensions to the Windows Sockets specification. For example, ConnectEx(), AcceptEx() and etc. These functions are to fully utilize IOCP power for all IO operations including receive (read) and send (write).

Yes, it's gonna be a long journey but it must be fun! So excited! LOL