Path: csiph.com!usenet.pasdenom.info!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.117 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.78; '*S*': 0.01; 'problem?': 0.07; 'dan': 0.09; 'testing,': 0.09; 'yeah,': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'thread': 0.14; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'handler,': 0.16; 'op.': 0.16; 'unlikely': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'seems': 0.21; 'programming': 0.22; 'cc:addr:python.org': 0.22; 'creating': 0.23; "aren't": 0.24; 'cc:2**0': 0.24; 'header :In-Reply-To:1': 0.27; 'scale': 0.29; 'message- id:@mail.gmail.com': 0.30; 'easier': 0.31; "they'll": 0.31; 'probably': 0.32; 'run': 0.32; 'running': 0.33; 'becomes': 0.33; 'brian': 0.33; 'not.': 0.33; 'third': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; "he's": 0.36; 'similar': 0.36; 'half': 0.37; 'sometimes': 0.38; 'server': 0.38; 'pm,': 0.38; 'even': 0.60; 'skip:u 10': 0.60; 'logged': 0.60; 'most': 0.60; 'happen': 0.63; 'more': 0.64; 'different': 0.65; 'asynchronous': 0.84; 'complexity': 0.84; 'etc),': 0.84; 'etc,': 0.84; 'game,': 0.84; 'games.': 0.84; 'hard.': 0.84; 'players.': 0.84; 'production,': 0.84; 'quote,': 0.84; 'dozen': 0.91; 'to:none': 0.92; 'hundred': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=mR7DRYLGLFBRqURZw6Mdj94/q0VT+UJ6tWXVdwv3MeU=; b=C42isrqQ9PYIzfmgpEDFKhWotXNzCeUJW2FpNzIcrFq/9CbRB8MW+ne4onGoWTHim1 JwX2T11d+ioUpYSD+0zJDiDLDlCq+APsymPpCEsKNpFBjAj826rdN4NF87/ocmo9oxhn 3wAyG5vjOBIu+S3X2G5UuJKgkYa5D1bPvtn19pZciJtzznlRTnkwo00XXLlNu5DpSodo Wkc427aJFwlfShxNkJ5AxdK4R3I6NRQZwaShOYa8Bl+b1PZgIga1pcvKNS6K6oaLBvYN yqUhbtU1Dr1GV3XgfVe5DHKS8MWCJIq8P0xDFktPDQfByEKQL+0xq2uPlrwGyG/4sQ5c +jpg== MIME-Version: 1.0 X-Received: by 10.66.160.2 with SMTP id xg2mr1101530pab.23.1389241205346; Wed, 08 Jan 2014 20:20:05 -0800 (PST) In-Reply-To: References: <22d58d76-f2c2-4a1d-8049-3409ac4665d3@googlegroups.com> Date: Thu, 9 Jan 2014 15:20:05 +1100 Subject: Re: Learning python networking From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1389241208 news.xs4all.nl 2964 [2001:888:2000:d::a6]:48513 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:63566 On Thu, Jan 9, 2014 at 2:49 PM, Dan Stromberg wrote: > The third quote, from Brian Kernighan, seems to underestimate the > complexity of asynchronous programming in the large - it's probably > not just twice as hard. Yeah, which is why I recommended a threaded approach to the OP. It won't scale to millions of simultaneous connections... but he's unlikely to have more than half a dozen in testing, and even in production, most games aren't going to run more than a couple hundred players. (A huge server might have more players than that simultaneously logged in, but they'll be running different games. If thread count becomes a problem, fork() to create a game, job done.) Threads are easier to get your head around: this and that happen at the same time. Sometimes it means creating lots of threads to do similar things (one for the GUI, one for this socket, one for that socket, one for the cron handler, etc, etc), but is that really a problem? Probably not. ChrisA