diff options
author | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2021-04-27 13:28:47 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@verizonmedia.com> | 2021-04-29 12:22:22 +0000 |
commit | 42c2917d2093673a8ca4658d6d800d9b2d8ee4ee (patch) | |
tree | 7598f346c492d8f1b2382c89c1c9c45e440ec1f5 /staging_vespalib | |
parent | 2b9209357f649d18e91bd3d9cf382fcc20591201 (diff) |
Add DistributorStripe thread pool with thread park/unpark support
To enable safe and well-defined access to underlying stripe data
structures from the main distributor thread, the pool has functionality
for "parking" and "unparking" all stripe threads:
* Parking makes all threads go into a blocked holding pattern where
it is guaranteed that they may not race with any other threads.
* Unparking releases all threads from their holding pattern, allowing
them to continue their event processing loop.
Also adds a custom run loop for distributor threads that largely
emulates the waiting semantics found in the current framework ticking
thread pool run loop. But unlike the framework pool, there is no global
mutex that must be acquired by all threads in the pool. All stripe
event handling uses per-thread mutexes and condition variables. Global
state is only accessed when thread parking is requested, which happens
very rarely.
Diffstat (limited to 'staging_vespalib')
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/util/document_runnable.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/util/document_runnable.cpp b/staging_vespalib/src/vespa/vespalib/util/document_runnable.cpp index e9e5cbbf953..53fe3c8a1d0 100644 --- a/staging_vespalib/src/vespa/vespalib/util/document_runnable.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/document_runnable.cpp @@ -26,7 +26,7 @@ bool Runnable::start(FastOS_ThreadPool& pool) if (_state != NOT_RUNNING) return false; _state = STARTING; if (pool.NewThread(this) == nullptr) { - throw vespalib::IllegalStateException("Faled starting a new thread", VESPA_STRLOC); + throw vespalib::IllegalStateException("Failed starting a new thread", VESPA_STRLOC); } return true; } |