Commit ad94bf4
committed
concurrent: move request submission off event loop thread
ConcurrentExecutorListResults now uses a dedicated submitter thread
instead of calling _execute_next inline from the event loop callback.
This decouples I/O completion processing from new request serialization
and enqueuing, yielding ~6-9% higher write throughput.
The callback now just signals a threading.Event; the submitter thread
drains a deque and calls session.execute_async in batches. This avoids
blocking the libev event loop thread with request preparation work
(query plan, serialization, tablet lookup) that takes ~27us per request.
Bug fixes included:
- Start submitter thread after initial batch (avoid race on _exec_count)
- Write _exec_count under _condition lock (avoid race with _current)
- Use exhausted flag to avoid repeated StopIteration on iterator1 parent d83adab commit ad94bf4
2 files changed
Lines changed: 604 additions & 16 deletions
0 commit comments