Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'indicated': 0.07; 'suppose': 0.07; 'bytes.': 0.09; 'missed': 0.12; 'assume': 0.14; 'thread': 0.14; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; 'subject:Thread': 0.16; 'threads.': 0.16; ':-)': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'skip:1 30': 0.19; 'thu,': 0.19; 'skip': 0.24; 'earlier': 0.24; 'header:In-Reply- To:1': 0.27; "doesn't": 0.30; 'besides': 0.30; 'said,': 0.30; 'message-id:@mail.gmail.com': 0.30; '(maybe': 0.31; "d'aprano": 0.31; 'sep': 0.31; 'steven': 0.31; 'probably': 0.32; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'ram': 0.36; 'subject:?': 0.36; 'should': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'most': 0.60; 'skip:1 20': 0.65; "they'd": 0.84; 'subject:much': 0.91 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:content-type; bh=WOyh45fwb2WHJjnv4aKcDAO1D3/IVeh5rMMjF7zM4mc=; b=vFpTkIvNj2v9VyppoC7p0eEcDRjWwFQA8xjMkG77qhUhvmtfZ95vo/Oh76QzshS/wn r7LvMNs80h8mJEEGHCk4J9Rqpn7aGDc3uNufZke/N6UV7CHqyg0X7q70PMkeqRVGiUvw EajGZMfHmhWXNXprO/gWBxPRlXU9Qk5yg4IN395Ol358W5yA91MpRwjXMnKM34jGUPfe Ju2bvvE7B0pCywTWQyNStVNt/RPhSXVSGD7cjGgwx+iil0LoTtogT0sRrpgizR0H21Ln FkBs6NwYBgxJz1lZzcnuuWPqXi2LAq5YL+HNQxaWyiLjDQqEVEHB3hvu5QScxaVnvfkS puwQ== MIME-Version: 1.0 X-Received: by 10.42.161.198 with SMTP id u6mr6545035icx.31.1410485932441; Thu, 11 Sep 2014 18:38:52 -0700 (PDT) Sender: skip.montanaro@gmail.com In-Reply-To: <54124c95$0$29991$c3e8da3$5496439d@news.astraweb.com> References: <20140911193018.GA24416@arxnet.hu> <54124c95$0$29991$c3e8da3$5496439d@news.astraweb.com> Date: Thu, 11 Sep 2014 20:38:52 -0500 X-Google-Sender-Auth: wLZEHirAtXeKFEGgb_ZS9tOrH34 Subject: Re: Thread-ID - how much could be? From: Skip Montanaro To: Python 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1410485934 news.xs4all.nl 2905 [2001:888:2000:d::a6]:55893 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77789 On Thu, Sep 11, 2014 at 8:29 PM, Steven D'Aprano wrote: > Suppose you somehow managed to create 9223372036854775807 threads. If your > computer has 16 GB of RAM available, that means that at most each thread > can use: > > py> 16*1024*1024*1024/9223372036854775807 > 1.862645149230957e-09 > > bytes. Doesn't that calculation assume that they all have to be alive at the same time? (Maybe I missed it in earlier posts, but I don't think the OP indicated they'd have to all be active.) That said, I think the OP should probably be worrying about other ways his program could fail besides overflowing some nonexistent max thread id. :-) Skip