Emacs crashes on Mac OS X with "Dispatch Thread Hard Limit Reached" Emacs crashes on me once a day or so with the same error message in the dump:


  Dispatch Thread Hard Limit Reached: 512 (too many dispatch threads blocked in synchronous operations)


Google shows this causes many programs on Mac OS X to crash, so I don't think it's specific to Emacs. The thread limit varies, but it seems to be built into the OS. I tend to open lots of files and run shells which start other processes, all inside Emacs, so I'm not surprised that it's hitting the limit, but I'm not sure how to prevent it. Any ideas?

This is GNU Emacs 24.2, built and installed from Homebrew with --cocoa, running on a late 2012 Retina MBP 13" on OS X Mavericks 10.9.1.
I posted this to another question you asked because it is indeed caused by Emacs 24.3 and related to distnoted acting up. As a solution you can either use a nightly from http://emacsformacosx.com/ or use the patch below to build 24.3 without leaks.

https://gist.github.com/anonymous/8553178