OK, that's useful to know. Thanks. :) -Morten
On Fri, Jul 29, 2022 at 3:43 AM Andrew MacIntyre <andy...@pcug.org.au> wrote: > On 29/07/2022 8:08 am, Chris Angelico wrote: > > It takes a bit of time to start ten thousand threads, but after that, > > the system is completely idle again until I notify them all and they > > shut down. > > > > (Interestingly, it takes four times as long to start 20,000 threads, > > suggesting that something in thread spawning has O(n²) cost. Still, > > even that leaves the system completely idle once it's done spawning > > them.) > > Another cost of threads can be memory allocated as thread stack space, > the default size of which varies by OS (see e.g. > > https://ariadne.space/2021/06/25/understanding-thread-stack-sizes-and-how-alpine-is-different/ > ). > > threading.stack_size() can be used to check and perhaps adjust the > allocation size. > > -- > ------------------------------------------------------------------------- > Andrew I MacIntyre "These thoughts are mine alone..." > E-mail: andy...@pcug.org.au (pref) | Snail: PO Box 370 > andy...@bullseye.apana.org.au (alt) | Belconnen ACT 2616 > Web: http://www.andymac.org/ | Australia > -- > https://mail.python.org/mailman/listinfo/python-list > -- I am https://leavingnorway.info Videos at https://www.youtube.com/user/TheBlogologue Twittering at http://twitter.com/blogologue Blogging at http://blogologue.com Playing music at https://soundcloud.com/morten-w-petersen Also playing music and podcasting here: http://www.mixcloud.com/morten-w-petersen/ On Google+ here https://plus.google.com/107781930037068750156 On Instagram at https://instagram.com/morphexx/ -- https://mail.python.org/mailman/listinfo/python-list