Algorithm: 1. create the pipe and create the process. 2. get the input in the main process and pass the output to the child process using pipe. 3. perform the operation given in the child process and print the output. 4. stop the program. Program: #include<stdio.h> #include<unistd.h> #include<string.h> int main() { int p1[2],p2[2],p3[2],p4[2]; int i,j=0,k=0,l=0; … Continue reading Implement pipe concept in Inter Process Communication using C program
Uncategorized
Shell program to find the sum of n numbers
Program: sum=0 i=1 echo "Enter the number of terms:" read n echo "Enter the numbers:" while [ $i -le $n ] do read a sum=`expr $a + $sum` i=`expr $i + 1` done echo "Sum is $sum" Output: chmod +x {filename.sh} ./filename.sh Enter the number of terms: 5 Enter the numbers: 1 2 3 4 … Continue reading Shell program to find the sum of n numbers
Round Robin Scheduling
Program: #include <stdio.h> int main() { int i,x=-1,k[10],m=0,n,t,s=0; int a[50],temp,b[50],p[10],bur[10],bur1[10]; int wat[10],tur[10],ttur=0,twat=0,j=0; float awat,atur; printf("Enter no. of process : "); scanf("%d", &n); for(i=0; i<n; i++) { printf("Burst time for process P%d : ", (i+1)); scanf("%d", &bur[i]); bur1[i] = bur[i]; } printf("Enter the time slice (in ms) : "); scanf("%d", &t); for(i=0; i<n; i++) { b[i] … Continue reading Round Robin Scheduling
Decision making and branching in C
In C programming it support sequential program statements which execute one statement immediately after another. Here the flow is sequential it never change the flow of control from the next line. The compiler executes the program sequentially in the order which they appear. This happens when there are no options and if the repeated steps … Continue reading Decision making and branching in C
What is Human Gene Editing?
Genome editing is a way of making changes to specific parts of a genome. Scientists have been able to alter DNA since the 1970s, but in recent years, they have developed faster, cheaper, and more precise methods to add, remove, or change genes in living organisms. Researchers are working to develop therapies that use gene … Continue reading What is Human Gene Editing?
Graphene Battery
Graphene is a composition of carbon atoms tightly bound in a hexagonal or honeycomb-like structure. What makes graphene so unique is that this structure is just one atomic layer thick, essentially making a graphene sheet two-dimensional. This 2D structure produces very interesting properties, including excellent electrical and thermal conductivity, high flexibility, high strength, and low … Continue reading Graphene Battery
Computer Architecture internal
1. Computer architecture can be defined as a set of rules and methods that describe the functionality, management and implementation of computers. To be precise, it is nothing but rules by which a system performs and operates. 2. Performance A / Performance B = Execution time B / Execution time B Thus the performance ratio … Continue reading Computer Architecture internal
Evolution of Operating Systems
The evolution of operating systems is directly dependent on the development of computer systems and how users use them. Here is a quick tour of computing systems through the past fifty years in the timeline. Early Evolution 1945: ENIAC, Moore School of Engineering, University of Pennsylvania.1949: EDSAC and EDVAC1949: BINAC - a successor to the ENIAC1951: UNIVAC by Remington1952: IBM 7011956: The interrupt1954-1957: FORTRAN was developed Operating … Continue reading Evolution of Operating Systems
Remote Procedure Call and Remote Method Invocation
RPC stands for Remote Procedure Call which supports procedural programming. Tt’s almost like IPC mechanism wherever the software permits the processes to manage shared information Associated with an environment wherever completely different processes area unit death penalty on separate systems and essentially need message-based communication. The above diagram shows the working steps in PRC implementation. … Continue reading Remote Procedure Call and Remote Method Invocation
CPU Scheduling Algorithms
A Process Scheduler schedules different processes to be assigned to the CPU based on particular scheduling algorithms. There are six popular process scheduling algorithms which we are going to discuss in this chapter − First-Come, First-Served (FCFS) SchedulingShortest-Job-Next (SJN) SchedulingPriority SchedulingShortest Remaining TimeRound Robin(RR) SchedulingMultiple-Level Queues Scheduling These algorithms are either non-preemptive or preemptive. Non-preemptive … Continue reading CPU Scheduling Algorithms