[Crossfire-wiki] [Crossfire DokuWiki] page added: dev_todo:thread_the_server

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Fri Sep 22 11:16:41 CDT 2006


A page in your DokuWiki was added or changed. Here are the details:



Date        : 2006/09/22 11:16

User        : 

Edit Summary: created



====== Threading the server ======

===== Plans/Ideas =====

  * Per-map threads and per-player threads

  * Mutex locks in players, and in 'map queues'.

    * 'map queues' are queues of things for a map thread to do, that it is
 told to do by other maps.

  * One map thread when wanting to do something such as teleport an object
 to another map, get a lock on the map's queue and put it in a queue of th
ings for ther other map thread to do in it's next tick.

  * In order to avoid all chance of deadlock, do this when processing the 
queue of things other threads told the thread to do:

    - Lock it's queue

    - Copy it's queue and clear the origional

    - Unlock it's queue

    - Process the copy of the queue.

    * Otherwise, there is a small chance that two processing queues at the
 same time might want to lock eachother to add to the list.





===== Issues to watch out for =====

  * Have to be careful to avoid deadlock circumstances.



----



FIXME put information from the logs of IRC discussion here





IP-Address  : 192.139.27.18

Old Revision: none

New Revision: http://wiki.metalforge.net/doku.php/dev_todo:thread_the_serv
er



-- 

This mail was generated by DokuWiki at

http://wiki.metalforge.net/





More information about the crossfire-wiki mailing list