Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

lazily create worker threads #2

Open
mndrix opened this issue Sep 4, 2013 · 0 comments
Open

lazily create worker threads #2

mndrix opened this issue Sep 4, 2013 · 0 comments

Comments

@mndrix
Copy link
Owner

mndrix commented Sep 4, 2013

Jolog currently spawns CpuCount*2 threads on startup. For many programs, we don't need that many threads so starting them is wasteful. Instead, start with one worker thread. Each time the manager thread prepares to block (because it's outpaced the workers), start a new thread. At most CpuCount*2 workers should ever run.

There are many more optimizations we could make to tune worker count based on CPU usage and blocking IO usage, but this small adjustment is easy and should help quite a bit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant