I meant to write about this a while ago, but I forgot, and it just popped into my head for some reason.
If you’re ever using POSIX signals as a means of primitive IPC, and SIGUSR1 and SIGUSR2 aren’t enough for you, never, ever, EVER make use of SIGRTMIN and/or SIGRTMIN plus some offset. Always use SIGRTMAX and SIGRTMAX minus some offset.
(Disclaimer: this might only be a problem on Linux, but if you want your app to be portable, blah blah blah…) Depending on what C library you’re using, and what pthreads implementation you’re using, the actual numerical value of SIGRTMIN may not be the same in different applications, depending on — get this — whether or not the app links with libpthread. In my case, the pthread impl makes use of the first 3 SIGRT slots, and so when you use the SIGRTMIN macro, you actually call __libc_current_sigrtmin(), and you get a number that’s 3 higher than what you get when you use SIGRTMIN in an app that doesn’t link against libpthread.
Fortunately, SIGRTMAX (which actually expands to a call to __libc_current_sigrtmax()) seems to be a bit more stable. That is, even if SIGRTMIN gets shifted up 3 slots, SIGRTMAX is still the same.
So, the moral of the story is: I never want to see the SIGRTMIN macro ever appear in your code, unless you really know what you’re doing. Instead, use things like SIGRTMAX, SIGRTMAX-4, etc. It may just save you 4 hours of debugging.
Sadly, we didn’t get accepted into Google’s Summer of Code this year. It’s a shame, but I’m glad I went through the effort to apply. If nothing else, we got some potentially-useful ideas and possibly some developer interest. Obviously we can’t fund any of these people, but it would be great if they still want to contribute.
Update: The coordinator got back to me, and said our ideas page wasn’t very fleshed out, and that we should look at other accepted applicants and the program guidelines for help on how to do this right… never mind that I actually *did* look at some older accepted projects, and their ideas lists were at times even more sparse than ours (though many were much more formally written up as well). Also she gave the usual “we can’t accept every great project” excuse, which at least gives some hope for next year. I’m not particularly sure I want to go through the work to apply again, but maybe someone else will.
While we haven’t been accepted into the program yet, we (Xfce) are applying to participate in the 2008 Google Summer of Code as a mentoring organisation. Please see our wiki page for more information, and add your name to the students list if you’d like to work on one of the projects. Feel free to add to the project ideas list as well.
If you’d like to act as a mentor, you still have a few more days before I submit the application. Add your name to the mentors list and email me to let me know.