[MUD-Dev] [TECH] Server Bottlenecks

Daniel.Harman at barclayscapital.com Daniel.Harman at barclayscapital.com
Thu Sep 4 10:53:03 CEST 2003


From: Eamonn O'Brien [mailto:decado at 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 at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list