Skip to content

About

Experiment with thread scheduling

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Thread Simulation

Tool for experimenting with thread scheduling, inspired by CPUStress.

Features

  • Activity per thread, or a custom work, period and waitable timer (default/high resolution)
  • Wake source per thread, waitable timer (priority increment 0), an event (1) or a window message (2)
  • Start delay per thread, for example so one thread owns the shared mutex first
  • Relative priority (idle to time critical), priority boost, group affinity, CPU sets, ideal processor per thread
  • Shared mutex for priority inversion
  • Process priority class, affinity, CPU sets
  • Change priority, priority boost, affinity, CPU sets, ideal processor, process settings while running
  • Suspend, resume, stop threads
  • Thread state & wait reason, base & current priority, running priority distribution, context switches, CPU % and CPU time (QueryThreadCycleTime)
  • Some presets for specific scenarios in assets\examples\, see comments in each file for some additional notes:

CPU Starvation

Priority Inversion

Priority Preemption

Priority Boosting

Priority Decay

Quantum Expiration

See 'Priority Separation, Duration Captures' / 'Context Switching, WrQuantumEnd' for details/notes on the captures.

Verify Binaries

All releases have a detached GPG sig, import the public key and verify the file next to its sig:

curl.exe -fsSL https://pgp.noverse.dev -o public.asc
gpg --import public.asc

gpg --verify thread-sim-Portable-<version>-x64.zip.sig thread-sim-Portable-<version>-x64.zip
gpg --verify thread-sim.exe.sig thread-sim.exe

It must show Good signature from "nohuto <contact@noverse.dev>", made by the signing subkey FF65 399D 1B28 95F6 CC34 BE79 1853 081F E103 04A2.

Preview

CLI

thread-sim.exe [--data-dir <dir>] [--config <file.jsonc>]
  • --data-dir = settings.json location (default %LOCALAPPDATA%\thread-sim)
  • --config opens a config at startup

About

Experiment with thread scheduling

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages