[Freeciv-Dev] Re: (PR#13351) Meta-ticket: AI and threads
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13351 >
On Tue, Jun 28, 2005 at 01:59:32AM -0700, Per I. Mathisen wrote:
> > Would 2 processes be better than 2 threads? The AI could then be sent
> > information in the same way as the clients (using the network code, but
> > through a pipe).
>
> Then much of the AI code would have to be rewritten, since it depends on
> being able to read server state directly. Much of the AI's data is not
> accessible through the network interface.
But the server code depends on no one reading its structures while it's
updating them, so I'm not sure whether fixing the AI to be a seperate
process is really any harder than fixing both AI and the server to lock
structures appropriately. Having AI be a seperate process -- just another
client, really -- would also be more elegant, and eliminate the annoying
capability of cheating (at the cost of making the AI stupider, of course).
-- Benoît
|
|