Re: Odd behavior of ncurses with -threaded

2010-11-15 Thread Simon Marlow
On 12/11/2010 17:25, Donn Cave wrote: Quoth Simon Marlowmarlo...@gmail.com, ... Is there anything that we could do in GHC to improve the situation? I suppose we could have a dedicated OS thread who's job it was to sit around and run the signal handler every Nth of a second. Since the

Re: Odd behavior of ncurses with -threaded

2010-11-12 Thread Simon Marlow
On 11/11/2010 22:41, Bryan O'Sullivan wrote: On Thu, Nov 11, 2010 at 2:32 PM, Edward Z. Yang ezy...@mit.edu mailto:ezy...@mit.edu wrote: I was under the impression we fixed this: http://hackage.haskell.org/trac/ghc/ticket/850 That is, we should be using SIGVTALRM, not SIGALRM,

Re: Odd behavior of ncurses with -threaded

2010-11-12 Thread Bryan O'Sullivan
On Fri, Nov 12, 2010 at 8:07 AM, Simon Marlow marlo...@gmail.com wrote: Is there anything that we could do in GHC to improve the situation? I suppose we could have a dedicated OS thread who's job it was to sit around and run the signal handler every Nth of a second. Maybe that would work,

Re: Odd behavior of ncurses with -threaded

2010-11-12 Thread Donn Cave
Quoth Simon Marlow marlo...@gmail.com, ... Is there anything that we could do in GHC to improve the situation? I suppose we could have a dedicated OS thread who's job it was to sit around and run the signal handler every Nth of a second. Since the -threaded RTS automatically spawns a couple

Odd behavior of ncurses with -threaded

2010-11-11 Thread Simon Hengel
Hello, the following program should wait 3 seconds for user input before. If now user input occurs within that time, it just prints -1. {-# LANGUAGE ForeignFunctionInterface #-} module Main where import Foreign import Foreign.C.String import Foreign.C.Types import

Re: Odd behavior of ncurses with -threaded

2010-11-11 Thread Donn Cave
Quoth Simon Hengel simon.hen...@wiktory.org, ... This works just fine if I do not use the threaded RTS, say: ghc --make -lcurses Main.hs However, with ghc --make -threaded -lcurses Main.hs I bet, if you switch off the barrage of thread scheduling SIGALRMs, +RTS -V0 -RTS , it will

Re: Odd behavior of ncurses with -threaded

2010-11-11 Thread Simon Hengel
ghc --make -threaded -lcurses Main.hs I bet, if you switch off the barrage of thread scheduling SIGALRMs, +RTS -V0 -RTS , it will work like it's supposed to. That helped, thanks! Cheers, Simon ___ Glasgow-haskell-users mailing list

Re: Odd behavior of ncurses with -threaded

2010-11-11 Thread Edward Z. Yang
Excerpts from Donn Cave's message of Thu Nov 11 17:07:20 -0500 2010: ghc: 6.12.1 linux: 2.6.32 ncurses: 5.7 Someone probably should. It's tempting to conclude that the bug is in ncurses, and perhaps it is, and maybe there's nothing to be done about it anyway, but a language

Re: Odd behavior of ncurses with -threaded

2010-11-11 Thread Bryan O'Sullivan
On Thu, Nov 11, 2010 at 2:32 PM, Edward Z. Yang ezy...@mit.edu wrote: I was under the impression we fixed this: http://hackage.haskell.org/trac/ghc/ticket/850 That is, we should be using SIGVTALRM, not SIGALRM, these days, except under certain conditions when your operating system

Re: Odd behavior of ncurses with -threaded

2010-11-11 Thread Donn Cave
Quoth Simon Hengel simon.hen...@wiktory.org, ghc --make -threaded -lcurses Main.hs I bet, if you switch off the barrage of thread scheduling SIGALRMs, +RTS -V0 -RTS , it will work like it's supposed to. That helped, thanks! Great, but, beware - I am not fully informed on what it