From: David B. <dav...@gm...> - 2011-02-01 18:48:09
|
Hi Deepak, > For this :- > 1. First i initialize a thread pool(dynamically), pushed them in a > stack and put them into a > waiting state. > 2. Whenever we want to run a thread then a thread( refer by thread > ID ) and then > activating them. > 3. When a particular thread complete it's task it pushed itself > into a stack and then gets to > waiting state So it looks like a single server program, with a separate port and thread for each game. That sounds like the most elegant way to do it (or at least it will be really cool once it is finished and debugged). > One thing i forget to ask that which library are we using for > handling thread on window platform. Till now i am using pthread > library(on linux) for handling thread and it can be easily converted > in SDL library function for handling thread. > I currently make the windows releases by cross-building from Linux using mingw-cross-env: http://mingw-cross-env.nongnu.org mingw-cross-env contains pthreads from: http://sourceware.org/pthreads-win32 Hope that helps, David |