From owner-freebsd-current@FreeBSD.ORG Thu May 29 22:07:27 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8341C3EE for ; Thu, 29 May 2014 22:07:27 +0000 (UTC) Received: from COL004-OMC3S1.hotmail.com (col004-omc3s1.hotmail.com [65.55.34.139]) by mx1.freebsd.org (Postfix) with ESMTP id 592712D33 for ; Thu, 29 May 2014 22:07:27 +0000 (UTC) Received: from COL131-DS7 ([65.55.34.136]) by COL004-OMC3S1.hotmail.com with Microsoft SMTPSVC(7.5.7601.22678); Thu, 29 May 2014 15:07:20 -0700 X-TMN: [RJIzm/bOPA5NNUcBO0G9YkbcrNAAEmbM] X-Originating-Email: [fredhps10@hotmail.com] Message-ID: From: Fred Pedrisa To: "'Jan Bramkamp'" , "'freebsd-current'" References: <00c301cf7aee$b00caea0$10260be0$@rlwinm.de> <00d301cf7af9$d5ce5bb0$816b1310$@freebsd.org> <01d401cf7b88$dce41ea0$96ac5be0$@rlwinm.de> In-Reply-To: <01d401cf7b88$dce41ea0$96ac5be0$@rlwinm.de> Subject: RES: RES: KQueue vs Select (NetMap) Date: Thu, 29 May 2014 19:07:45 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHirpLONkJpDgmFWk/rBALGUBsbjAGIqyNfAVVbklMCH1/FHQF9GR9CAnIkcA4BbwHobQIiLZPxms3I1KA= Content-Language: pt-br X-OriginalArrivalTime: 29 May 2014 22:07:20.0161 (UTC) FILETIME=[5C51ED10:01CF7B8A] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 22:07:27 -0000 Ok. Thanks for the enlightenment :) -----Mensagem original----- De: owner-freebsd-current@freebsd.org [mailto:owner-freebsd-current@freebsd.org] Em nome de Jan Bramkamp Enviada em: quinta-feira, 29 de maio de 2014 18:55 Para: 'freebsd-current' Assunto: Re: RES: KQueue vs Select (NetMap) On 29.05.2014 06:57, Fred Pedrisa wrote: > Hello, > > There are 4 threads, and a total of 32 FDs. What do you think ? > > -----Mensagem original----- > De: owner-freebsd-current@freebsd.org > [mailto:owner-freebsd-current@freebsd.org] Em nome de Adrian Chadd > Enviada em: quinta-feira, 29 de maio de 2014 01:52 > Para: Fred Pedrisa > Cc: freebsd-current; Jan Bramkamp > Assunto: Re: KQueue vs Select (NetMap) > > If your netmap thread(s) just have one or two FDs in some low range > (say, under FD 8 or 10) - no. > > If you have a whole bunch of active FDs and your netmap threads get > FDs that are high - then yes. select() operates on a bitmap of FD > numbers. So if your netmap FD is like, FD 8 and it's the highest FD > that you're interested in, > select() only has to scan up to that FD. So it scans up to 8 FDs. If > you have a very active program and it has thousands of FDs open, > select() has to check all the FDs in the bitmap to see if they're set > before getting to your netmap FD. If your threads use just a handful of small FDs than you shouldn't see any performance difference between select()/poll() and kqueue(). But kqueue() can block on multiple event types. This can simply your netmap threads main loop. It sometimes even enables you to get by with just one type of main loop instead of multiple different main loops for different interfaces e.g. one for timers, one for sockets and one for files. _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"