[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GSoC 2017] Number fo sockets

From: Mark H Weaver
Subject: Re: [GSoC 2017] Number fo sockets
Date: Thu, 24 Aug 2017 06:30:37 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)


Joan Lledó <joanlluislledo@gmail.com> writes:

> As I mentioned in my previous post about ioctl operations[1], LwIP
> establishes a maximum limit of sockets, which is a big problem for a
> system like the Hurd. Now I've finished all tasks in my initial
> proposal, I thought it was a good idea to spend some time studying
> this issue and trying to find a solution.
> The problem is this: in LwIP, sockets are stored in a fixed-size
> array, which is the best solution for embedded systems as it is a
> natural way of indexing items without need of additional variables and
> allows the user to directly access any socket from its index taking
> the same time. If we remove the limited amount of sockets, then we
> cannot keep using an array, and another solution is required to handle
> all this.
> In the LwIP translator, I've chosen to replace the array for a linked
> list, and that has some implications: the need to iterate the list any
> time we need to create, destroy or look for a particular socket,

I would be good to avoid having socket lookup require time proportional
to the number of sockets.  The number of sockets may grow quite large in
some applications.

Instead of a linked list, how about using a dynamic array?


This would give you constant-time lookups, amortized constant time
insertions and deletions, and better data locality and cache behavior.

What do you think?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]