Hi,
Because Multithreadsystem is hard to understand I (and maybe some other) need some Informations
Basic informations are:
How many Thread and what Threads we have?
What is handle in each Thread?
Some Threadinformations
FreezeThread - This Thread check, if the WorldThread is in freeze
SoapThread
Config-option: SOAP.Enabled
Ra-Thread
Config-Option: Console.Enable
MapThread
the amound can control with MapUpdate.DynamicThreadsCount and MapUpdate.Threads
all Worldobjects update ticks from a specific maps are handle in one of this threads
some Network Threads
some Database Threads
How I unterstand Player actions?
Player loggin and lands on WorldSocket, now we create a new WorldSession
that function is called in void Map::Update(const uint32 &t_diff). Every Player has one WorldSession and the Map-Updater gets Session over the player.
In my eyes this looks good. Problems can accure with global stuff and dirty transports
Questions:
Where we have Thread crossovers? Where we handle global collections like Guilds, BG-joinLists?
I know we have database Thread. How are handle database threads? Why we need more then one?
I think the locking of the last objects like PetList, AggroList is totally wrong. This List should use by one thread (the specific map-thread)
I hope that someone can help. Please write only english, better long simply sentences as to short and hard to unterstand.
Reamer[code]
Because Multithreadsystem is hard to understand I (and maybe some other) need some Informations
Basic informations are:
How many Thread and what Threads we have?
What is handle in each Thread?
Some Threadinformations
- WorldThread(MainThread)
- important method int Master::Run()
- this thread starts a lot of other thread
- in this the hole world are loaded in void World::SetInitialWorldSettings() (Startup) - also MapThreads are started here with
- Code:
///- Initialize MapManager
sLog.outString( "Starting Map System" );
sMapMgr.Initialize();
- starts a listener socket
How I unterstand Player actions?
Player loggin and lands on WorldSocket, now we create a new WorldSession
- Code:
// NOTE ATM the socket is single-threaded, have this in mind ...
ACE_NEW_RETURN(m_Session, WorldSession(id, this, AccountTypes(security), expansion, mutetime, locale), -1);
- Code:
m_Session->QueuePacket(new_pct);
- Code:
/// Add an incoming packet to the queue
void WorldSession::QueuePacket(WorldPacket* new_packet)
{
_recvQueue.add(new_packet);
}
- Code:
ACE_Based::LockedQueue<WorldPacket*, ACE_Thread_Mutex> _recvQueue;
that function is called in void Map::Update(const uint32 &t_diff). Every Player has one WorldSession and the Map-Updater gets Session over the player.
In my eyes this looks good. Problems can accure with global stuff and dirty transports
Questions:
Where we have Thread crossovers? Where we handle global collections like Guilds, BG-joinLists?
I know we have database Thread. How are handle database threads? Why we need more then one?
I think the locking of the last objects like PetList, AggroList is totally wrong. This List should use by one thread (the specific map-thread)
I hope that someone can help. Please write only english, better long simply sentences as to short and hard to unterstand.
Reamer[code]
Last edited by Reamer on Tue Jul 10 2012, 14:29; edited 3 times in total