Skip to content

Handle dynamic changing of the number of active CPUs on OpenBSD#1619

Open
busterb wants to merge 2 commits intoaristocratos:mainfrom
busterb:fix-openbsd-smt-online-cpus
Open

Handle dynamic changing of the number of active CPUs on OpenBSD#1619
busterb wants to merge 2 commits intoaristocratos:mainfrom
busterb:fix-openbsd-smt-online-cpus

Conversation

@busterb
Copy link
Copy Markdown
Contributor

@busterb busterb commented Apr 21, 2026

This is an additional set of improvements on #1587

The set of online CPUs can change dynamically while btop is running, but the stats vectors and UI were only sized in init(). If the number of CPUs increases, say by switching hw.smt from 0 to 1, or with OpenBSD 7.9 removing 'S' from hw.blockcpu, the resulting vector is too small, resulting in this error:

ERROR: Exception in runner thread -> Cpu:: -> collect() : vector

This adds an additional check on each collect() call for the number of currently online CPUs. It also sets Runner::coreNum_reset when there is a change so the display is updated for the current number of CPUs.

Tested on an assortment of machines from 4 to 16 CPUs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant