Re: kill or pipe

Pet Farrari <pf@xxxxxxxxxxx> writes:

With FreeBSD 6, during IPC, what method is better, sending signal thru
kill or use pipe to communicate between processes(between parent and
child processes and among child processes?


Both methods are good for different situations. Also sockets, RPC,
corba, etc.

With kill, you can signal the parent's whole process group in one fell
swoop whereas with pipes, all children would need to fork with all
required pipes open and then decide which ones and directions they can
close. This makes it complicated for the children to set up pipes
between one another. Pipes are not the way you want to go.

Try "gunzip < /usr/share/doc/psd/21.ipc/paper.ascii.gz | less"

This gives info on using combinations of signals, sockets and select
statements for IPC and should help you decide the way to go.



Relevant Pages

  • Re: Send one stream down two pipes
    ... I started coding it with signals, but I don't see how to ... The main problem is where pid A sends his signal to pid B, ... mkfifo "$td/3" ... echo -en "$ts" | pipes ...
  • Re: Clueless: piping between 2 non-python processes
    ... ideally you'd close all other file descriptors in the child process ... Well, if these are the only child processes his program spawns, he can ... > brittle, because pipes have a fixed, limited buffer size and because ... to call fflushor change their I/O library's buffer settings as needed. ...
  • Re: Clueless: piping between 2 non-python processes
    ... that's more to avoid keeping a file ... UNIX file descriptors are ... | Well, if these are the only child processes his program spawns, he can ... | If buffering is a problem, the processes comminicating via pipes are welcome ...
  • Re: Son processes dont die when father die..
    ... At each time the process is reattached to init. ... Because i use pipes in my script commands, i cannot use kill %1, %2... ...
  • Child processes dont get the close on pipe
    ... I have a problem with pipes that I do not understand at all. ... forks a number of child processes, and creates a pipe for every one of ... print $writer "Got some work\n"; ... local *READER; ...