[Top][All Lists]

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

Re: [GSoC 2017] Number for sockets

From: Kalle Olavi Niemitalo
Subject: Re: [GSoC 2017] Number for sockets
Date: Sat, 12 Aug 2017 21:38:23 +0300
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.51 (gnu/linux)

Svante Signell <svante.signell@gmail.com> writes:

> How much effort is it to implement lwip_poll?

lwip_select constructs a struct lwip_select_cb on the stack
and adds that to the global linked list select_cb_list.
event_callback searches the list for structures that relate
to a particular socket, and wakes up the corresponding threads
so that the lwip_select calls will return.

One would have to
- change struct lwip_select_cb so that it can carry a
  struct pollfd * as an alternative for the three fd_sets;
- copy lwip_select and lwip_selscan to new functions and
  make them use struct pollfd;
- change event_callback to check whether the struct
  lwip_select_cb was made by lwip_poll, and run a linear
  search on the struct pollfd array if so.

All of those are defined in api/sockets.c and struct
lwip_select_cb is of course not referenced elsewhere,
so I don't expect anything else would have to change.

The implementation effort might be 4 hours, not including testing
and publication.  The lwip test suite is not included in the
lwip-hurd tree, but one could implement and test lwip_poll in the
lwip tree and then copy it over.

reply via email to

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