[OpenSIPS-Devel] pkg_malloc question

Stanisław Pitucha viraptor at gmail.com
Sun Mar 21 14:49:31 CET 2010


On 21.03.2010 13:24, Alex Massover wrote:
> I'm trying to overcome performance bottle neck caused by blocking I/O by using threads, I can't wait for 2.0 which probably will take at least a year.
Every other module requiring async operations uses another process -
isn't that enough for what you're trying to do? What kind of bottlenecks
are you experiencing? Solving anything with threads may be quite hard,
as you're still stuck with the same packet even if you export some query
to the thread - the best you can achieve really is collapsing many IO
ops into one time period with many threads.

What operations are you trying to optimise?

> It would be great if somebody could explain if I understand things correctly, please:
> 
> a)      AFAIU, pkg_malloc is not thread-safe, so I can't use it and should switch to system malloc.
Most probably it isn't - there's nothing inside it that would indicate
either locking or atomic operations.

> b)      If compiled with system malloc, memory is allocated dynamically and pre-allocating a chunk of shared memory (-m flag) is not a case anymore.
In case of +SYSTEM_MALLOC -PKG_MALLOC, yes that seems to be the case
(although I haven't used it that much, so not sure if that's a proper
way to set it up)



More information about the Devel mailing list