-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-threads command line parameter is accepted but has no effect #227
Comments
The same behaviour happens in Windows 10 21H2 with https://github.com/xaos-project/XaoS/releases/download/release-4.2.1/xaos-4.2.1.zip I was thinking XaoS was simply built without thread support and I only need to enable it. But looking at the source code it seems thread support should be present. I also see it depends on a pthread library in Ubuntu, and is distributed with libwinpthread-1.dll in Windows. Comparing my XaoS 3.5 build with xaos-4.2.1.zip in process explorer, it's clear that 3.5 uses 4 threads for calculation and 4.2.1 only uses 1, even though both were run with |
The problem was that command line parameters were being parsed after thread initialization. In pull request #228 I move thread initialization after command line argument parsing. As a workaround, without making any changes to code, it is possible to use multiple threads by editing the configuration file. In the The value provided to the Edit: In Windows thread count is stored in the registry at |
Move thread initialization after parameter parsing, fixing #227
Describe the bug
If I run
xaos -threads 4
, there is no error message, but only a single CPU core is used for calculationTo Reproduce
I'm running Ubuntu 21.10 on x86_64 with a quad core CPU. The same behaviour happens with the xaos 4.2.1-2 package distributed with Ubuntu and https://github.com/xaos-project/XaoS/releases/download/release-4.2.1/xaos_4.2.1-Ubuntu-20.04_amd64.deb. (The download doesn't successfully install due to depending on libicu66 (>= 66.1) but is still usable.)
With no other tasks using a lot of CPU time, run
xaos -threads 4
, maximize the window, zoom in deeply with iteration limit set to 5000, and monitor CPU usage. Only one CPU core will be fully utilized, with only sporadic little bits of activity on other cores. Clearly only one core is used for calculation.Expected behavior
When using multiple cores, deep zooms should result in usage of all cores. An old win32 build of XaoS 3.5 which I made with Pthreads-w32 does that, up to around 82% usage in Windows 10. Performance is obviously much better this way when zoomed in deeply.
If usage of multiple cores is not supported by a build of XaoS, there should be some error message to tell the user about that.
Desktop (please complete the following information):
Ubuntu 21.10 with Xorg, Xfce and compton compositor.
Additional context
I know I can probably build XaoS from source with functional multi threading, and will try that later. I know that some things break when using multiple threads.
The text was updated successfully, but these errors were encountered: