hfsevents icon indicating copy to clipboard operation
hfsevents copied to clipboard

Running out of file descriptors

Open harendra-kumar opened this issue 8 years ago • 2 comments

Is it possible to avoid using a pipe for communicating between C to Haskell? A pipe uses 2 fds. It will be much more scalable if we can do away with those fds.

Haskell stack runs out of fds on OSX while using filewatch via fsnotify. Please see commercialhaskell/stack#1979 .

harendra-kumar avatar Mar 31 '16 19:03 harendra-kumar

hmm, perhaps I can change it to use a single pipe for all watches. if many watches are created, having an thread for each of them would probably also be less than ideal.

luite avatar Apr 01 '16 12:04 luite

Haskell threads should be relatively cheap but pthreads on the C side might not scale well. Can we make watchCallback a Haskell function and use the C wrapper of the Haskell function in the C code? GHC supports that. That way we can avoid the pipes as well as pthreads, making the library scalable irrespective of how the application designers use it.

harendra-kumar avatar Apr 01 '16 17:04 harendra-kumar