arun11299 / cpp-subprocess

Subprocessing with modern C++
Other
449 stars 90 forks source link

Thread safety? #57

Closed jussihi closed 4 years ago

jussihi commented 4 years ago

Hello,

When running multiple subprocess-instances in different threads simultaneously, the program sometimes crashes into "bad file descriptor" when writing into the subprocess pipe.

I will try to add manual thread safety to my program (so that only one thread can use subprocess at a time), just to be sure that this is indeed the cause of the problem. But should the library be thread-safe?

arun11299 commented 4 years ago

Hello @jussihi For simplicity reasons, the library is not thread safe. It would be better to handle it in your application.

jussihi commented 4 years ago

@arun11299 thanks for clarifying it. I will do so in my own application.