erigontech / erigontech/silkworm

infra: context pools usage strategy

Open
#1,532 0 comments 0 reactions 0 assignees View on GitHub
performance
Dominant language
C++
Stars
318
Forks
84
PR merge metrics
No merged PRs in 30d

Description

Currently we have a bunch of ad-hoc context pools, contexts and threads.
The total number of threads is not exactly matching to the number of CPU cores, which might affect performance.

To put all context and thread usage into a single system we could introduce 3 global pools:
1. default context pool which may have multi-threaded contexts (waiting mode affects this)
2. synchronized context pool only uses single-threaded contexts
3. blocking thread/context pool leases threads for exclusive usage and allows blocking execution

If we only use these pools and not create ad-hoc contexts and threads,
we'll have an overview of the total number of threads in one place.

We might not need multi-threaded contexts (1) at the end after some WaitMode testing and so only have one context pool.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.