patchFreeciv - Patches: patch #3715, Threaded AI cities generating...

Show feedback again

patch #3715: Threaded AI cities generating Worker task requests

Submitted by:  Marko Lindqvist <cazfi>
Submitted on:  Mon Feb 18 02:32:04 2013  
Category: aiPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Planned Release: 2.5.0Contains string changes: None

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Tue Mar 26 01:53:29 2013, comment #6:

I committed my warning workaround, since no better ideas were suggested and it stops me building.

Jacob Nevins <jtn>
Project Administrator
Tue Mar 26 01:51:24 2013, SVN revision 22599:

Work around 'may be used uninitialized' warnings post patch #3715.

(Browse SVN revision 22599)

Jacob Nevins <jtn>
Project Administrator
Sat Mar 23 20:23:35 2013, comment #4:

Unfortunately this is giving warnings for me (GCC 4.4.3-4ubuntu5.1 on Ubuntu 10.04):

It seems clear that these are to me untrue, but I'm not sure how to persuade the compiler of that. Attached patch has the obvious workaround.

(file #17525)

Jacob Nevins <jtn>
Project Administrator
Fri Mar 8 03:53:45 2013, SVN revision 22496:

Threaded AI cities create worker task requests for autosettlers
to fulfill.

See patch #3715

(Browse SVN revision 22496)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Wed Feb 27 08:40:14 2013, comment #2:

- Set want for task requests for workers to prioritize between cities

As there's no fear to break threaded ai, as there really isn't distinct threaded ai yet (this patch is first to make it behave slightly different from classic which all users should still be using) I'm about to leave further improvements to future tickets.

(file #17360)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Thu Feb 21 07:37:43 2013, comment #1:

- Mutex protection for city existence. Now there should be no possibility of crash because of lack of mutex protection. It's possible that some data it handles is inconsistent due to main thread modifying it at the same time, but I consider this part of the nature of current threadedd ai (we're not after 100% accurate results, but fuzzy heuristics of what is likely the best action)
- Evaluats road and base building tasks, assigning them only if player is able to build extras in question to the tile

(file #17300)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Mon Feb 18 02:32:04 2013, original submission:

This proof-of-concept patch adds first real work to threaded AI's subthread. In the beginning of the player phase, cities evaluate potential worker tasks in their area, and send best one to the main thread to set for the city. When workers then have time, they take these tasks.

This still needs a lot of work before it gives as good results as current model of settlers always looking for job themselves.
- Supports only a few worker tasks, no road or base building
- Assumes that any task it evaluates is possible, i.e., may request impossible tasks
- Virtually no mutex protection so threads may handle the city simultaneously leading them to get inconsistent values
- Does not give out values of the tasks. Worker may end working on almost-zero-value task of one city when nearby city has urgent task.
- Does not care about lenght of the work, only about value of sfinished work

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.


(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #17525:  trunk-taicity-worker-task-init.patch added by jtn (785B - text/x-diff - trunk r22533: work around 'may be used uninitialized' warnings)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by jtn (Updated the item)
  • -unavailable- added by cazfi (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat Mar 23 20:23:35 2013jtnAttached File-=>Added trunk-taicity-worker-task-init.patch, #17525
    Fri Mar 8 03:53:55 2013cazfiStatusReady For Test=>Done
      Assigned toNone=>cazfi
    Wed Feb 27 08:40:14 2013cazfiAttached File-=>Added ThreadedCityRequests-3.patch, #17360
      StatusIn Progress=>Ready For Test
    Thu Feb 21 07:37:43 2013cazfiAttached File-=>Added ThreadedCityRequests-2.patch, #17300
    Mon Feb 18 02:32:04 2013cazfiAttached File-=>Added ThreadedCityRequests.patch, #17243
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup