xtendo-org / rawfilepath

Haskell library for encoding-free interaction with Unix system. Use RawFilePath (ByteString) instead of FilePath (String)
Other
17 stars 3 forks source link

callProcess may cause trouble in a multithreaded program #1

Closed xtendo-org closed 7 years ago

xtendo-org commented 8 years ago

@snoyberg says:

I'd be concerned about that implementation of callProcess: the forkProcess function itself is notoriously flakey, and by making the call to fork() from Haskell code instead of FFI code, there's the potential for another thread to grab control in the interim and cause trouble. You'd be better off either doing all of that work in the FFI, or (if you're willing to lose performance) make this code a wrapper around the process package.

(source)

I'll have to look into this soon.

Anyone interested may make a Pull Request; I'll be utterly grateful.

xtendo-org commented 7 years ago

The work is ongoing in the fork-ffi branch https://github.com/xtendo-org/rawfilepath/tree/fork-ffi

xtendo-org commented 7 years ago

I've put some time into it, and it's finally done. The new interface in 0.1.1 solved this issue. 🎉