Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2005:
[Freeciv-Dev] Re: (PR#13351) Meta-ticket: AI and threads
Home

[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]
Subject: [Freeciv-Dev] Re: (PR#13351) Meta-ticket: AI and threads
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Tue, 28 Jun 2005 01:59:32 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13351 >

On Mon, 27 Jun 2005, Benedict Adamson wrote:
> Per I. Mathisen wrote:
> > The idea discussed
> > earlier was IIRC to have one separate thread for the server and one for
> > the AIs.
...
> 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.

Two processes also cannot work together in the way necessary for the late
game, where the server thread must wait for the AIs to move, to avoid
synchronization issues.

> If we have multi threading, why not one thread per AI?

The trend seems dual core, so splitting it up into multiple threads would
just lead to more context switches. Once we have two threads, it would
seem easy to split it further up later on.

  - Per





[Prev in Thread] Current Thread [Next in Thread]