continued n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Nutt Exercise III PowerPoint Presentation
Download Presentation
Nutt Exercise III

Loading in 2 Seconds...

play fullscreen
1 / 9

Nutt Exercise III - PowerPoint PPT Presentation


  • 133 Views
  • Uploaded on

continued. Nutt Exercise III. Signal handlers. The complete program on p. 91 illustrates how a signal handler is registered with the signal() system call (see man page on cs01) Also illustrates how the whole signaling system operates Also illustrates the form of a signal handler

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Nutt Exercise III' - corbin


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
signal handlers
Signal handlers
  • The complete program on p. 91 illustrates how a signal handler is registered with the signal() system call (see man page on cs01)
  • Also illustrates how the whole signaling system operates
  • Also illustrates the form of a signal handler
  • See code on cs01, modified
problem statement part a
Problem statement (Part A)
  • A: use ITIMER_REAL to implement your version of gettimeofday().
    • Set it so it raises a signal once a second
    • Use signal facility to determine when ITIMER_REAL has been decremented to 0 and to count the number of seconds elapsed
problem statement part b
Problem statement (Part B)
  • B: Design & implement facilities that use ITIMER_VIRTUAL and ITIMER_PROF interval timers to profile a process.
    • Profiler provides actual time of execution using timer from Part A
    • CPU time
    • User-space time
    • Kernel-space time
more on part b
More on Part B
  • Use your gettimeofday() to compute program’s “wall clock” runtime
  • All times should have millisecond accuracy, even though you might not get this level of accuracy in reality
  • Use signal facility to create signal handlers to keep track of the number of seconds of virtual and profile time
    • Raise signal once a second
problem statement part c
Problem statement (Part C)
  • Write a subject program to spawn 2 children, with each child recursively computing a Fibonacci sequence (the dumb way using f(n) = f(n-1)+f(n-2) directly)
    • Run it for n=20, 30, and 36
    • Take note and report on the timer printouts