[Bro-Dev] open a pipe?
bernhard at ICSI.Berkeley.EDU
Mon Mar 26 08:07:18 PDT 2012
On Mar 26, 2012, at 7:53 AM, Robin Sommer wrote:
>>> global myfile = open("| shasum> output");
> I'm coming around on this if we move the execution of the pipe into a
> thread. With the new thread infstrastructure, that should be mostly
> straight-forward and get us around all the blocking problems.
> Actually, I'm wondering if non-packet IOSources should generally move
> into threads (e.g., the DNS Mgr).
We just have to be a little bit careful about that, because it mixes threading and forks. Seth and me are already testing that in the input framework for a bit - and it seems to work.
But it is not that easy to find straight answers if it is a good idea to call popen (which essentially does a fork and passes the command to "sh -c") in a thread - opinions on the tread-safety of popen seem to be divided.
More information about the bro-dev