summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-07-20 19:46:35 +0300
committerPaul Buetow <paul@buetow.org>2026-07-20 19:46:35 +0300
commitb69ed3923e42f122910242e724ee9dc43208d7b4 (patch)
tree93e35d15d5c0b5f63f7300859a63d6a334fe90e7 /src/window.c
parentd97ed0600618cd12159f10e0bcba300cbcaee2ab (diff)
thumbnail: bound the decode thread pool so large folders don't peg the CPU
thumbnail_get_async used g_task_run_in_thread, which runs on GLib's unlimited shared thread pool — every visible cell's thumbnail decode spawned its own thread, pegging every core (load ~20, 74 running threads on a 613-image folder). Move the decode onto a GThreadPool owned by Thumbnail, capped at max(1, min(num_cpus/2, 4)) threads. g_task_return_* still marshals each result to the main thread, so callbacks are unchanged. Observed: 74 -> 2 active decode threads, load ~20 -> ~5. If the pool failed to create, fall back to g_task_run_in_thread so thumbnails still work (just unbounded) rather than not at all.
Diffstat (limited to 'src/window.c')
0 files changed, 0 insertions, 0 deletions