[tarantool-patches] Re: [PATCH v2] core: Non-blocking io.popen
Konstantin Osipov
kostja at tarantool.org
Fri May 31 20:32:44 MSK 2019
* Vladimir Davydov <vdavydov.dev at gmail.com> [19/05/31 16:01]:
> > +static struct popen_data *
> > +popen_lookup_data_by_pid(pid_t pid)
> > +{
> > + struct popen_data *cur = popen_data_list;
> > + for(; cur; cur = cur->next) {
> > + if (cur->pid == pid)
> > + return cur;
> > + }
>
> Please write a comment explaining why you think linear search is fine
> here and why we don't use some kind of hash or tree.
If it is a list of all popen processes, please avoid.
We can't afford adding a yet another, even unlikely, reason for a
100% hog. This makes support difficult - keeping them all one's
head and checking neither is triggered.
--
Konstantin Osipov, Moscow, Russia
More information about the Tarantool-patches
mailing list