EmbLogic's Blog

Breif Discussion of fork ,pipe and execl.

Process:- Process is execution of set of statements in sequential way.

Fork():-It is a system call that create a duplicate process of the process which is evoking the system call(fork). After the fork statement the remaining part of a process is executed by two process if fork system call is used once. It creates one duplicate process with a new process id and and with parent process id same as that of process that is calling this system call. And program counter is given from where it is called. we can create as much process as we want in our project.As shown in Figure.

Pipe:- Pipe is a virtual link between the two process that are related in past for communicating between them. Pipe is a size of ram that is maximum 64kb but at a time you can just write 4kb in it. Pipe is form of circular queue which create array of least file descriptors available. At 0 index of that array you will find a file descriptor for reading from the pipe and at 1 index file descriptor of writing data into the pipe is available you can use any file descriptor at a time.And once the data is read from the pipe it is deleted automatically. and if you are reading from the pipe you need to write from another process otherwise if writer is not available then pipe will go in read on block condition and it will wait till something is written in the pipe and similarly the case is for write on block if their is no one to read from pipe.

Execl():- It is a statement which takes the execution process to other program given in its argument. And the current program is hijacked by other program.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>