~/talk

Visualized multi-threaded simulators in Ruby

Talkat EuRuKo 2024 · 2024-09-11..09-13· [ruby]
linkedin:jakubgodawa
slides:none on file

A visualized petrol‑station simulator implemented in MRI Ruby uses a custom shared timer plus mutexes, condition variables and queues to run pumps as consumer threads while a car spawner lazily yields arrivals from a YAML scenario. It runs many simulations in parallel (tested >10) without one thread per car, compares setups like 3 pumps @3s/L versus 6 pumps @6s/L and picks the highest‑revenue scenario (example: simulation 8 wins), and renders results live with d3.js and ASCII art.

AI-written summary · about

  1. 0:00Introduction
  2. 5:31Petrol station scenarios
  3. 7:15Logger and timer
  4. 11:36YAML configuration
  5. 13:42Car spawner and queue
  6. 16:33Ruby thread conditions
  7. 18:57Lessons learned
  8. 21:47Future ideas
  9. 23:18Resources
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.