From owner-freebsd-hackers@FreeBSD.ORG Sat Jun 7 16:06:39 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 16EE38B8 for ; Sat, 7 Jun 2014 16:06:39 +0000 (UTC) Received: from mail-qa0-x22c.google.com (mail-qa0-x22c.google.com [IPv6:2607:f8b0:400d:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA6502A36 for ; Sat, 7 Jun 2014 16:06:38 +0000 (UTC) Received: by mail-qa0-f44.google.com with SMTP id j7so5984292qaq.3 for ; Sat, 07 Jun 2014 09:06:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=jqbZDIa+clr7XY386wfhKcUalxAJJwLx9uJe8kfbo1M=; b=F+WALp4ifhSd37aOAUvaRTpPVEXpEq7xi4uq7edPDddIyHaXp28I0MtwCGHyKs2+dL Te0WA7gIyljsrR0cI421CGrcgbh1Sm/gfnMg/nerLl8L+9efYpcvbPe7hEJDnUnuwfR2 +CORuV/YY1urI6OkEZLTgW4b2cpJ+MoBWrPoXTNTFjBQae7oWRHjPyyapi6LO3ASUNbk o5gWy5sJ0iDzT2Sg5GcO74YX4JhTdANMr2b8papgpENWinfo1uFqOoUduI7y8PbzOJL9 Qmg60fCzVa1zJn2E25GSy756z79sz2od2njWl5tZTIKiRW5U/X1U3FF7CJT2XJEGYViY XDbg== MIME-Version: 1.0 X-Received: by 10.224.37.10 with SMTP id v10mr18943011qad.98.1402157197894; Sat, 07 Jun 2014 09:06:37 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.43.134 with HTTP; Sat, 7 Jun 2014 09:06:37 -0700 (PDT) In-Reply-To: References: Date: Sat, 7 Jun 2014 12:06:37 -0400 X-Google-Sender-Auth: 5_vPQI2RgQjcONv2FE9uyzT9cW8 Message-ID: Subject: Re: Best practice for accepting TCP connections on multicore? From: Adrian Chadd To: Igor Mozolevsky Content-Type: text/plain; charset=UTF-8 Cc: Daniel Janzon , Hackers freeBSD , Dirk Engling X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jun 2014 16:06:39 -0000 On 7 June 2014 10:19, Igor Mozolevsky wrote: > On 7 June 2014 01:53, Dirk Engling wrote: > >> >> On Sat, 7 Jun 2014, Daniel Janzon wrote: >> >> Is there any better way than doing the accept() call in one thread and >>> then >>> dispatch it to a thread on another core with any user space method? >>> >> > See C10K problem [1]. > > > Why use accept() and not kevent()? You need to keep it portable? >> > > Has anyone rebutted the threads better than events paper[2] yet? > > > > 1. http://www.kegel.com/c10k.html > > 2. > https://www.usenix.org/legacy/events/hotos03/tech/full_papers/vonbehren/vonbehren.pdf Not likely; but that paper talks about a threading model that isn't currently in use in popular UNIX operating systems. It also compares a lightweight thread implementation with a lightweight server to an event driven system with worker threads that acted pretty badly, causing extremely bad memory use and context switching. We've all gotten better at programming since then. -a