diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-13 21:02:43 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-13 21:02:43 +0200 |
| commit | 79627ce3c419a6a6d6e03c83e7c62333b60345d8 (patch) | |
| tree | 7ef5501392cfa2c6ef80e02b573f064cfb7bd891 /lib/Loadbars/Shared.pm | |
| parent | 7a90962d2e940f50f807448d2d4c23c2631e2922 (diff) | |
Replace Perl threads with fork() for multi-host monitoring
Major refactoring to fix SDL threading crashes on modern Linux with
sdl12-compat. Perl threads are incompatible with SDL 1.2 compatibility
layer, causing segfaults in TTF_RenderText_Solid.
Changes:
- Replace threads::create with fork() for process-based concurrency
- Implement IPC using pipes instead of threads::shared memory
- Add read_from_processes() to handle pipe-based data transfer
- Update signal handling for SIGTERM and SIGUSR1 in child processes
- Remove all :shared attributes from variables
- Update process termination to use waitpid() instead of thread joins
This allows loadbars to monitor multiple remote hosts simultaneously
without SDL threading conflicts. Each host runs in its own forked
process with completely separate memory space.
Tested successfully with 3 remote hosts on Fedora 43.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'lib/Loadbars/Shared.pm')
| -rw-r--r-- | lib/Loadbars/Shared.pm | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/Loadbars/Shared.pm b/lib/Loadbars/Shared.pm index 1cf6e80..4240c71 100644 --- a/lib/Loadbars/Shared.pm +++ b/lib/Loadbars/Shared.pm @@ -19,24 +19,24 @@ our @EXPORT = qw( %I ); -our %PIDS : shared; +our %PIDS; -our %CPUSTATS : shared; -our %AVGSTATS : shared; -our %AVGSTATS_HAS : shared; +our %CPUSTATS; +our %AVGSTATS; +our %AVGSTATS_HAS; -our %MEMSTATS : shared; -our %MEMSTATS_HAS : shared; +our %MEMSTATS; +our %MEMSTATS_HAS; -our %NETSTATS : shared; -our %NETSTATS_HAS : shared; -our %NETSTATS_INT : shared; +our %NETSTATS; +our %NETSTATS_HAS; +our %NETSTATS_INT; # Global configuration hash -our %C : shared; +our %C; # Global configuration hash for internal settings (not configurable) -our %I : shared; +our %I; # Setting defaults %C = ( |
