Commit Graph
5 Commits
Author SHA1 Message Date
David Evans 97919c94f9 Better error type for inactive thread pools (#1787)
* Better error type for inactive thread pools

* Soundness

* Typos

* PR comments

* Defer ELG shutdown

* Remove redundant try
2021-03-22 10:01:39 +00:00
Cory Benfield 30961d2f05 Properly allow ThreadPool to be started multiple times. (#1572)
Motivation:

Our API documentation claims that NIOThreadPool.start() will tolerate
being called multiple times. However, this wasn't actually true: in
debug mode it'd hit an assertion, and in release mode it would quietly
orphan all its threads and replace them with new ones, leaving there
with twice as many threads and some that wouldn't be closed down.

We should support the functionality we claim we do.

Modifications:

- Fixed the incorrect check for running thread pool state.
- Added a test to validate we actually allow multiple starts.

Result:

Thread pools really can be started multiple times.
2020-06-25 11:14:43 +01:00
Johannes Weiss b2d937b22f shorten NIOThreadPool's thread names (#1466)
Motivation:

Previously, NIOThreadPool would use super long thread names. Linux
doesn't allow more than 15 bytes (+ \0 char) so in the end they would
never get set at all.

Modifications:

- Shorten NIOThreadPool's thread names
- Only take the first 15 characters of thread names in general on Linux

Result:

We don't lose thread names on Linux.
2020-03-31 20:01:56 +01:00
Johannes Weiss 8c6c83c05d NIOThreadPool: backed by NIOThreads (pthreads) instead of DispatchQueues (#1100)
Motivation:

NIOThreadPool was grossly abusing Dispatch to block a large number of
threads for (usually) blocking IO work.

Modifications:

Back the NIOThreadPool by NIOThreads (pthreads) instead of
DispatchQueues.

Result:

Less abuse.
2019-08-09 15:20:53 +01:00
Johannes Weiss afbab95f27 address #186: rename BlockingIOThreadPool to NIOThreadPool (#838)
Motivation:

The thread pool implementation can be used for many things not just
blocking IO.

Modifications:

rename BlockingIOThreadPool to NIOThreadPool

Result:

fixes #186
2019-02-25 16:51:47 +00:00