Thread-ID - how much could be?

Skip Montanaro skip at pobox.com
Fri Sep 12 03:38:52 CEST 2014


On Thu, Sep 11, 2014 at 8:29 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> 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



More information about the Python-list mailing list