[Freeciv-Dev] Re: Threads!!??
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Tue, Feb 06, 2001 at 05:03:20PM +0100, Fabio Lopiano (ELN) wrote:
> What about having the AI players in separate client-like processes ?
> We could have something like an ai_civclient process which will
> run like any human client, getting all info from the network.
Yes, Raimar Falke, IQ and others are working on that.
See the recent archives.
[Jordan wrote:]
> If not, then I am looking for comments on a couple of different options
> for the AI to receive and process event packets:
>
> A) - Send the messages to the appropriate AI hooks as they come up in
> the list, ie:
>
> if (i_am_ai) ai_send_packet(blah); else send_to_network(boah);
The server itself isn't multithreaded. The AI players really don't
participate in the asynchronicity of multiplayer mode.
> This has the disadvantage of delaying the sending of packets to
> legitimate players while we crunch the AI.
Note if you put the AIs on localhost or even Unix sockets.
That way you don't have to maintain AI-specific interfacing code.
> A2) - A slight variant on the above -- send all network packets first,
> and then handle the hooks for all AI
> This has the disadvantage of delaying the receiving of incoming packets
> while we crunch the AI
It will always be a hack, though.
> B) - Add AI players to their own thread, and set them up with a socket
If you're adding a socket, why not let them be full network connections?
(Unix sockets can be a generic option, also available for human players.)
I don't think programming with threads in C is feasible, you'll hurt
portability.
--
Reinier
- [Freeciv-Dev] Re: Threads!!??, Fabio Lopiano (ELN), 2001/02/06
- [Freeciv-Dev] Re: Threads!!??,
Reinier Post <=
- [Freeciv-Dev] Re: Threads!!??, Jordan Crouse, 2001/02/06
- [Freeciv-Dev] Re: Threads!!??, Jed Davis, 2001/02/06
- [Freeciv-Dev] Re: Threads!!??, Raimar Falke, 2001/02/07
- [Freeciv-Dev] Re: Threads!!??, Reinier Post, 2001/02/07
- [Freeciv-Dev] Re: Threads!!??, Jordan Crouse, 2001/02/07
- [Freeciv-Dev] Re: Threads!!??, Raimar Falke, 2001/02/07
|
|