System calls vs procedure calls how much more expensive is


Question: System Calls vs. Procedure Calls: How much more expensive is a system call than a procedure call? Write a simple test program to compare the cost of a simple procedure call to a simple system call (getpid() is a good candidate on UNIX; see the man page.) To prevent the optimizing compiler from "optimizing out" your procedure calls, do not compile with optimization on. You should use a system call such as the UNIX gettimeofday() for time measurements. Design your code such that the measurement overhead is negligible. Also, be aware that timer values in some systems have limited resolution (e.g., millisecond resolution). Explain the difference (if any) between the time required by your simple procedure call and simple system call by discussing what work each call must do.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: System calls vs procedure calls how much more expensive is
Reference No:- TGS02271741

Expected delivery within 24 Hours