Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2000:
[Freeciv-Dev] Re: Working on client APIs
Home

[Freeciv-Dev] Re: Working on client APIs

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jrb3@xxxxxxxxx
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Working on client APIs
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 8 Jul 2000 14:24:32 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxxxx

On Fri, Jul 07, 2000 at 01:51:45PM -0700, jrb3@xxxxxxxx (Joseph Beckenbach III, 
CCP) wrote:
> 
>       Has anyone started working on this, either as direct multithread
> support, or as "defining the client-side API"?  I have a gut feel that all
> the code will need to be rewritten to be multithreaded, and then let the
> single-threaded client support be a special case (eg Lock() and Unlock()
> on the "shared data areas" as no-ops for the single-threaded)

I have started on defining and implementing an API for client side AI. The
basic structure in my current design is a general layer, which does caching
and the network stuff. This layer exports an API to the upper layer, which 
I termed "control program". This part can be written in any language. The
interaction is quite simple throught callbacks: the lower layer sniffs a
packet from the network, updates the cache and calls a notify callback in
the upper layer. The upper layer then can use the cached data to make a
decision and call some set_* method in the lower layer. My test control 
program is now written in C and can at least call turn_done() if it gets 
a new_year_notify. This allows to get a whole game from -4000 till the
server-AI kills me in some minutes.

There is no multithreading in this design. I'm not sure if there is a
situation where mutlithreading is needed. Since I don't know any thread
package for C can somebody recommend one?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Just because you put a flag on the moon doesn't make it yours, it just
  puts a hole in the moon."



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