Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2001:
[Freeciv-Dev] Re: Threads!!??
Home

[Freeciv-Dev] Re: Threads!!??

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jordan Crouse <jordanc@xxxxxxxxxxx>
Cc: Freeciv developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Threads!!??
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 7 Feb 2001 10:48:49 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxxxx

On Tue, Feb 06, 2001 at 05:41:49PM -0700, Jordan Crouse wrote:
> > The current AI in the server will stay at least till the client side
> > AI is equal or better compared to the server AI. The term "better"
> > should cover game play strength, resource usage and use-ability. So
> > you don't need to worry that the server AI will get obsolete in the
> > next time.
> 
> I expect the AI will be constantly evolving on both sides for many moons
> to come. 
> 
> > I haven't worked with threads in C. However I have heared it isn't
> > easy. Do you have any experience with threads in C. Threads are a nice
> > concept but so are processes.
> 
> Actually, threads are processes that haven't been completely spawned
> off.  Threads and processes both maintain their own
> stack and PC information (and are thus handled individually by the
> scheduler), but where processes are given their own memory space, 
> threads share the same memory as the calling process.  This had its
> advantages and disadvantages.   The advantage is that you can have
> multiple execution points, but only one memory footprint.  That is
> useful for servers and GUI applications that are processor intensive 
> (browsers come to mind -- the HTTP handling is on a separate process so
> the GUI doesn't lock up while you're accessing a slow site).

Threads have shared memory and so only one memory footprint. However
every modern OS will also use CopyOnWrite for mulitple instances of
the same programm. This reduces memory footprint.

I think shared memory is for the case we discuss now a
disadvantage. We want to ensure that no AI is cheating by using
information from the server or other AI's memory. It also increases
the robustness to have separate processes which can be restarted.

> If we are moving it out to the clients, however, threads would be
> redundant.  
> 
> > Extra silicon cycles or extra brain cycles?
> 
> I can offer both, though I think most people would prefer a faster
> machine than mine.

Nice.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "How about the new language C&? No, that's not 'c ampersand', 'c reference', 
  'reference to c' or 'c and'. It's pronounced 'campersand', to confuse the 
  hell out of people who are unfamiliar with it, and it will, of course, 
  have no pointers."
    -- Xazziri in comp.lang.c++ about C#



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