[Haskell-cafe] syscall, sigpause and EINTR on Mac OSX

Joel Reymont joelr1 at gmail.com
Sun Dec 11 15:48:31 EST 2005


On Dec 11, 2005, at 8:35 PM, Donn Cave wrote:

> Now if you actually have observed that your SIGINT handler was entered
> at this point, then please ignore me.

Yes, I have observed my SIGINT handler being triggered out of nowhere.
Since I'm printing the signal# in the handler I actually know that it  
was SIGINT.

Since we are dealing with computers and magic is out of the question  
I can only
think of Mac OSX sending SIGINT when the program went over some  
resource limit.
Probably not, though, as I left it running in gdb, went to sleep,  
woke up about
an hour and a half later to see that the program stopped after about  
15 minutes
and dropped into the debugger with a SIGINT. gdb has nothing to do  
with this
as I saw it happen outside of the debugger.

For the record, I often ^C the program as it's supposed to run forever,
with poker bots just sitting their, playing and grabbing more money
when they run out of it. The C++/Windows server is not very good at  
handling
abrupt disconnects so it helps when certain commands are sent to it  
before
a client disconnects. This is what I do in the SIGINT handler by  
placing QUIT
events into each thread's mailbox.

I sorely miss the Erlang REPL here, btw, with its ability to send  
messages
to various running processes and such. I'm also thinking of designing  
a "process"
class in Haskell to emulate Erlang processes, together with the  
associated
infrastructure to keep track of processes, their message counts, etc.
I do not want to recode my stuff in Erlang as Erlang FFI makes me  
grind my teeth
and I would need to use it to get to the OpenSSL BIO API and for ZLib.
I also invested over two months into the Haskell project by now and  
it's 95% done.

	Joel

--
http://wagerlabs.com/







More information about the Haskell-Cafe mailing list