Author iunknwn
Recipients Matt Spitz, bquinlan, dmacnet, iunknwn, josh.r, methane, pitrou, tomMoral, torsten
Date 2018-04-24.22:32:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1524609143.72.0.682650639539.issue24882@psf.upfronthosting.co.za>
In-reply-to
Content
I feel like there are two reasonable options here:

1) We can implement a thread pool with basic resource tracking. This means idle threads get recycled, and threads that have been sitting idle for a while are terminated as demand drops, so resources can be reclaimed. This wouldn't require very much work - we would just need to modify some of the queue operations to have timeouts, and track the number of idle threads (most of that's already in my first PR). We could easily add options like min_threads and idle_thread_timeout as options in kwargs to the init routine. 

2) We can skip all tracking, and spin a fixed number of threads at initialization. This removes the complexity of locks and counts, and means the thread pool executor will work identically to the process pool executor (which also eagerly spawns resources). If we want this, this is ready to go in the second PR. 

I personally like option 1 because it feels closer to other languages I've worked in, but I'd like a bit more guidance from the reviewers before proceeding.
History
Date User Action Args
2018-04-24 22:32:23iunknwnsetrecipients: + iunknwn, bquinlan, pitrou, methane, torsten, josh.r, Matt Spitz, tomMoral, dmacnet
2018-04-24 22:32:23iunknwnsetmessageid: <1524609143.72.0.682650639539.issue24882@psf.upfronthosting.co.za>
2018-04-24 22:32:23iunknwnlinkissue24882 messages
2018-04-24 22:32:23iunknwncreate