installHandler, sleep, and interrupts.

Anders Lau Olsen alauo at mip.sdu.dk
Tue Oct 30 13:31:35 EST 2001


I later ran into another problem that may or may not be related with the
first. This is the program I am running:

    module Main where
    import Posix

    main = do
        installHandler sigCONT (Catch (putStrLn "- resumed -")) Nothing
        forever $ do
            c <- getChar
            putChar c

    forever = sequence_ . repeat

This is the output from a conversation with the shell:

    % ./program &
    [2] 8959
    [2]  + Suspended (tty input)         ./program
    % fg
    ./program
    a
    a
    b
    b
    c
    c
    d
    d
    e
    e- resumed -

The handler is run not shortly after the signal is received, but only
after a sufficient amount of I/O or processing has been done by the main
process.

Anders Lau Olsen





More information about the Glasgow-haskell-bugs mailing list