Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.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.057 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'sys': 0.07; 'utf-8': 0.07; 'means,': 0.09; 'cc:addr:python-list': 0.11; 'def': 0.12; 'template': 0.14; 'thread': 0.14; 'name=none,': 0.16; 'number?': 0.16; 'peak': 0.16; 'subject:Thread': 0.16; 'to:addr:web.de': 0.16; 'exception': 0.16; 'thanks,': 0.17; 'wrote:': 0.18; 'thu,': 0.19; '>>>': 0.22; 'memory': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'helper': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'sep': 0.31; 'class': 0.32; 'run': 0.32; 'skip:_ 10': 0.34; 'could': 0.34; 'received:google.com': 0.35; 'there': 0.35; '+0200,': 0.36; 'thanks': 0.36; 'subject:?': 0.36; 'that,': 0.38; 'skip:_ 30': 0.39; 'how': 0.40; 'eventually': 0.60; 'hope': 0.61; 'new': 0.61; 'from:charset:utf-8': 0.61; 'content-disposition:inline': 0.62; 'name': 0.63; 'maximum': 0.63; 'reached': 0.63; 'limit': 0.70; 'upper': 0.74; 'again?': 0.84; 'otten': 0.84; 'peter,': 0.84; 'received:86': 0.91; 'subject:much': 0.91; 'system:': 0.91; 'received:hu': 0.93; 'reply,': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=9EA8c8Y0rouzOY5JTdhdD2yal/MBx801cdwFscYlQjw=; b=zKbV0zhzOlOaAfZpHCWXo87JsDWWFtKdsOZfP5ZOn3GfGFOohy5H4CDTBFcHPIWhob YIGapHJVUnhqc53RuTNc4tRJ0youl0Dje27XXICljyVWJBJeU0iolH1RpYMLHWMWI8Ym DpUwxjKDeJb8IgCRTfydnCr6+kBSDt9e2JeiJSNsnSCtKcpN5IlpSbnfNVOO7nyv8sJO 76a05kEnR4wgNYTjerzbS5q05FUXV3f9qv59AxeQG/6XzjHFQ8HZjAXkTw4Rjv72KFyV zM/K1JQkBwJ0IQInJ/PblJGKNk70GrTCMrW/sruSyWU+nbVBWjh1oAdg9ChLKbQRRgG+ 5b2w== X-Received: by 10.180.218.99 with SMTP id pf3mr10772219wic.19.1410471152523; Thu, 11 Sep 2014 14:32:32 -0700 (PDT) Date: Thu, 11 Sep 2014 23:32:29 +0200 From: Ervin =?utf-8?Q?Heged=C3=BCs?= To: Peter Otten <__peter__@web.de> Subject: Re: Thread-ID - how much could be? References: <20140911193018.GA24416@arxnet.hu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: python-list@python.org 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: 58 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1410471154 news.xs4all.nl 2944 [2001:888:2000:d::a6]:49700 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77780 Hi Peter, thanks for the reply, On Thu, Sep 11, 2014 at 09:48:18PM +0200, Peter Otten wrote: > Ervin Hegedüs wrote: > > > Exception in thread Thread-82: > > ... > > My question is: how much thread ID could be totally? Is there any > > maximum number? And if the thread reached that, what will be > > done? Overlflowed? Couting from 0 again? > > A quick peak into threading.py reveals > > # Helper to generate new thread names > _counter = 0 > def _newname(template="Thread-%d"): > global _counter > _counter += 1 > return template % _counter > > class Thread: > ... > def __init__(self, group=None, target=None, name=None, > args=(), kwargs=None, *, daemon=None): > ... > self._name = str(name or _newname()) > > > There is no upper limit to the thread name other than that you will > eventually run out of memory ;) thanks - I hope that the memory will not run out by these threads... :) Anyway, that means, on my system: >>> import sys >>> print sys.maxint 9223372036854775807 the couter could be 9223372036854775807? And after? :) Thanks, a. -- I � UTF-8