Open MarkowEduard opened 11 months ago
That's strange.. pause mode shouldn't really be doing anything other than running this forked thread:
void . forkIO $ forever $ do
writeBChan chan Tick
threadDelay delay
and brick's event handler handling those ticks:
handleEvent :: BrickEvent Name Tick -> EventM Name UI ()
handleEvent (AppEvent Tick) = do
ui <- get
unless (ui ^. paused || ui ^. game . to isGameOver) $ do
-- do normal game stuff
-- but when paused, do nothing.
First reasonable thing to do would be to update the brick dependency, the version used here is quite old and this may have been fixed there.
If tetris is put into sleep mode with the pause command it starts to increase its demand of the CPU resource. After a few days pausing it consumes currently more than 25 parts of 100 on a 8 core CPU (i.e. 255.99%). Top shows
What's going on there? When put into sleep mode it starts with consuming only very little (1.12%) of the CPU resource:
18900 zzzzzz 20 20 0 121M 26M uwait 4 0:00 1.12% tetris