System Call Overhead: Measuring Time For `getpid()` And `fork()'.pdf

lab03.pdf
Preview of System Call Overhead: Measuring Time for `getpid()` and `fork()'
🔗 Source: comp.nus.edu.sg
📊 Size: 106 KB
📄 Pages: 4 pages
⬇️ Downloads: 21

Summary

## CS2106 Lab 3 Summary

This lab exercise investigates system call overhead and explores concepts of orphaned and zombie processes, as well as process groups in Linux.

Key Concepts:

System Call Overhead: The cost (in CPU time) associated with making a system call compared to executing regular code.
Orphaned Process: A process that has finished execution but its parent hasn't reaped it using `wait()` or `pgrep()`.
Zombie Process: The state of an orphaned process. Its resources are released once the parent reaps it.
Process Group (PGID): A collection of one or more processes, identified by a PGID which is the PID of its leader.

Exercises and Solutions:

1. System Call Overhead:

(a) Measured CPU time for `getpid()` calls (1,000,000 times).
(b) Measured CPU time for direct `syscall(SYS_getpid);` (1,000,000 times) to bypass caching.
(c) Calculated average overhead of system calls compared to function calls based on the measured times.
(d) Determined if fork() is measured at parent or child process and calculated its average time in nanoseconds.

2. Orphan and Zombie Processes:

(a) Created a program `zombie.c` that leads to a defunct (zombie) process due to an infinite loop after forking.
(b) Used `kill` to terminate the zombie process and explained why it was called a "zombie."
(c) Created a modified version `orphan.c` of `zombie.c` resulting in a different parent process for the orphaned process, explaining the difference.

3. Process Groups:

(a) Observed PGIDs of processes created by running `eight.c`, identifying the leader and its associated group.
* (b) Documented the command to send a signal to a process group based on research in the `man` pages.

Description

Complete Lab 3 for CS2106 at NUS School of Computing by 9 September 2011, 11:59 PM. Submit a properly named text file with your answers via IVLE Workbin, using the provided template and Linux platform; adhere to formatting and naming guidelines to avoid deductions.

Technical Information

  • File Format: PDF
  • File Size: 106 KB
  • Pages: 4
  • Language: EN
  • Total Downloads: 21
  • Last Updated: 1 month ago

Document Overview

This PDF document about System Call Overhead: Measuring Time for `getpid()` and `fork()' provides comprehensive information and guidance. Whether you're a beginner or advanced user, this resource offers valuable insights into System Call Overhead: Measuring Time for `getpid()` and `fork()'.

Related Topics

If you're interested in System Call Overhead: Measuring Time for `getpid()` and `fork()', you might also want to explore:

Download System Call Overhead: Measuring Time for `getpid()` and `fork()' eBooks for free and learn more about System Call Overhead: Measuring Time for `getpid()` and `fork()'. These books contain exercises and tutorials to improve your practical skills, at all levels!

Not satisfied with this document? We have related documents to System Call Overhead: Measuring Time for `getpid()` and `fork()', try searching with similar keywords: System Call Overhead: Measuring Time for `getpid()` and `fork()', Självkänsla och KBT ‐ Påverkas självkänslan vid KBT för depression och ångesttillstånd?Se lf‐esteem and CBT ‐ How does CBT for de, "Hinder och möjliggörare för 1.5°-livsstilar: Ytliga och djupgående strukturella faktorer som påverkar potentialen för hållbar k, Ändring av genomföranderam för en europeisk plattform för utbyte av balansenergi från frekvensåterställn ingsreserver med manuell, Rekommendationer för vaccination mot covid-19 för särskilda grupper av barn -, förstudie för att utvärdera förutsättningarna att genom en innovationsupphandli ng utveckla en drifttjänst för geoenergilager, Matglädje för alla: en guide till rätt konsistens för olika behov, OVERHEAD CRANE OPERATOR SAFETY TRAINING OVERHEAD C

You can download PDF versions of the user's guide, manuals and ebooks about System Call Overhead: Measuring Time for `getpid()` and `fork()', you can also find and download for free A free online manual (notices) with beginner and intermediate, Downloads Documentation, You can download PDF files (or DOC and PPT) about System Call Overhead: Measuring Time for `getpid()` and `fork()' for free, but please respect copyrighted ebooks.