[Home] [Groups] - Message: [Prev in Group] [Next in Group]

nu.kanga.list.mud-dev

28028: RE: [MUD-Dev] [TECH] Server Bottlenecks

[Full Header] [Plain Text]
From: Daniel.Harman@barclayscapital.com
Newsgroups: nu.kanga.list.mud-dev
Date: Thu, 4 Sep 2003 10:53:03 +0100
Organization: Kanga.Nu
From: Eamonn O'Brien [mailto:decado@esatclear.ie]

> Why do you need 2 threads per player? Your socket code is
> presumably already multithreaded, so a reader/writer thread would
> seem redundant, I am also guessing there is one thread for the
> player in game which means everything needs to be synchronized,
> with mutexes, semaphores etc everywhere. Even using new and delete
> can become a major bottleneck with multiple threads. Every malloc
> could end up blocking until whichever other thread had the memory
> access semaphore gets around to freeing it (though obviously you
> could work around this in various ways).

I'm open to being corrected on this, but under win2k onwards I'm
fairly sure that new/delete use the windows heap allocator directly
which is apparently very efficient for multithreaded allocations
(don't think it uses a mutex).  Of course using the STL, you'll
still be stuffed by its node allocator which in all implementations
I've seen uses a mutex and can become a significant bottle neck if
you are doing a lot of string processing.

Dan
_______________________________________________
MUD-Dev mailing list
MUD-Dev@kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev