Re: Contest 2 Announcement:
- Posted by Patrick Barnes <mrtrick at gmail.com> Nov 30, 2004
- 533 views
On Mon, 29 Nov 2004 15:32:39 -0800, cklester <guest at rapideuphoria.com> wrote: > > > If you have 4 bots, that'll be a minimum of 8 seconds, whereas with > > > the threading, it's not necessarily that long... right? > > > > It'll be a maximum of 8 seconds, not a minimum. > > If you give each bot 2 seconds, it will be a minimum of 8 seconds (as well > as a maximum). I was comparing that against if you give each both "up to" > 2 seconds, which was what was said and I misread at first. :) The inter-process communication used is a combination of semaphores and shared memory. The engine sends a start signal to the bot, then waits on the return semaphore with a certain timeout. If all bots set their orders and return in only 0.1 seconds, that's fine! The engine will start the next turn much quicker, because it didn't have to keep waiting. If it times out, then it'll only process the orders of those who returned. -- MrTrick