From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 8C7663035A for ; Fri, 31 May 2019 13:32:49 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HRBbxeZHpGuK for ; Fri, 31 May 2019 13:32:49 -0400 (EDT) Received: from smtp41.i.mail.ru (smtp41.i.mail.ru [94.100.177.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id CDBAD3031A for ; Fri, 31 May 2019 13:32:48 -0400 (EDT) Date: Fri, 31 May 2019 20:32:44 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH v2] core: Non-blocking io.popen Message-ID: <20190531173244.GG31572@atlas> References: <20190529070809.18962-1-szudin@tarantool.org> <20190531114943.2zurdo3m6rct3hzk@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190531114943.2zurdo3m6rct3hzk@esperanza> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: Stanislav Zudin * Vladimir Davydov [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