Skip to content
Myr

render: limit number of worker threads to --lines

Before adoption: this commit came in with the history the project adopted, so no landing records it.

We can't parallelize more than that anyway...

authored by Daniel Eklöf · committed by Daniel Eklöf · parent b4ed87b · Browse files · 2 files+10 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+10 added−3 removed

  • other:+10 added−3 removed

2 files+10 added−3 removed

modified:CHANGELOG.md+5 added
30 unmodified lines
3132## Unreleased33### Added34### Changed3536* Number of render workers is now automatically limited to the number37 of displayed entries.383940### Deprecated41### Removed42### Fixed43
915 unmodified lines
modified:render.c+5 added-3 removed
1265 unmodified lines
1266 LOG_ERR("failed to instantiate render worker mutex: %d", err);1267 goto err_free_semaphores;1268 }12691270 render->workers.threads = xcalloc(render->conf->render_worker_count,1271 sizeof(render->workers.threads[0]));1270 const size_t num_workers = min(conf->render_worker_count, conf->lines);12711273 for (size_t i = 0; i < render->conf->render_worker_count; i++) {1272 render->workers.threads = xcalloc(1273 num_workers, sizeof(render->workers.threads[0]));12741275 for (size_t i = 0; i < num_workers; i++) {1276 struct thread_context *ctx = xmalloc(sizeof(*ctx));1277 *ctx = (struct thread_context){1278 .render = render,1279 .my_id = 1 + i,
189 unmodified lines