Skip to content

Program to Demonstrate the creation and destruction of processes under Linux

Aim: Program to Demonstrate the creation and destruction of processes under Linux

Source Code:

#include <stdio.h>
#include “shmlib.h”
#include <stdlib.h>

int main()
 {
        int id, s;
        printf(“Enter number of process:”);
        scanf(“%d”,&s);
        id = create_process(s);
        if (id>0)
        {
          printf(“Parallel execution strats n”);
          printf(“n o/p from child %d: My id %d n”,id,id);
        }
        else if(id==0)
        {
          printf(“o/p from paralle process:My id= %d”, id,id);
          join_process(s,id);
          printf(“nSequential execution is Finish”);
          printf(“n Bye Bye”);

        }
}


Output:

Comment bellow for your Query and Feedback

1 thought on “Program to Demonstrate the creation and destruction of processes under Linux”

Leave a Reply

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

error: Content is protected !!