[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Re: [lwip] memp_malloc
From: |
Kieran Mansley |
Subject: |
[lwip-users] Re: [lwip] memp_malloc |
Date: |
Wed, 08 Jan 2003 23:06:42 -0000 |
On Thu, 7 Mar 2002, Mumtaz Ahmad wrote:
> Hi
>
> Why does the code use memp_malloc at some places and memp_mallocp at others
> . I think if the code has to be run in mutithreading environment then
> memp_mallocp must always be used since this function is gaurded by
> semaphores .
...unless you know that resource will only be accessed by one thread.
Having had a look at the code (I don't know if this is right, but it looks
this way to me) the only places that use memp_malloc are in api_lib.c and
they are all requesting memory of the same type (MEMP_API_MSG). This type
is not requested from anywhere else, and the code in api_lib.c is always
executed by the same thread (I think!), so by not protecting it with
semaphores you should get a significant increase in performance. (API
msgs are still a big bottleneck, but it'd be worse otherwise)
Could all be wrong though. Adam will be along shortly to correct me...
Kieran
[This message was sent through the lwip discussion list.]
- [lwip-users] Re: [lwip] memp_malloc,
Kieran Mansley <=