5 Pages

ch5a

Course: CS 4061, Fall 2009
School: Minnesota
Rating:
 
 
 
 
 

Word Count: 438

Document Preview

19 - - 5.7 Controlling return place after handler Motivation * Synchronous events, e.g. divide by zero, null pointer * Returning to the instruction causing error - implies infinite loop * Default: exit() or abort() in handler * Q? What if we don't want to terminate process/thread? Change place of return after handler * Increment program counter (not portable) * Goto - missing stack management * siglongjmp...

Register Now

Unformatted Document Excerpt

Coursehero >> Minnesota >> Minnesota >> CS 4061

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
19 - - 5.7 Controlling return place after handler Motivation * Synchronous events, e.g. divide by zero, null pointer * Returning to the instruction causing error - implies infinite loop * Default: exit() or abort() in handler * Q? What if we don't want to terminate process/thread? Change place of return after handler * Increment program counter (not portable) * Goto - missing stack management * siglongjmp => proper stack management System calls: Siglongjmp(), sigsetjmp() (pp. 192) * Like "goto" and "set label" but * Unravel function call stack properly! * Portable across POSIX.1 operating systems - 20 - 5.7 Controlling return place after handler Synopsis (pp. 192) #include <setjmp.h> int sigsetjmp(sigjmp_buf env, int savemask); void siglongjmp(sigjmp_buf env, int val); Details of sigsetjmp() * sigsetjmp() - set the "label" in "env" * argument 1 = stores <program counter, state of stack> * nonzero argument 2 => save signal_mask as well! * returns 0 if called directly * returns "val" when returning from siglongjmp() - like exit(v) -- wait(&status) * Call sigsetjmp() at the return point after handler Details of siglongjmp() * siglongjmp(env, val) - similar to "goto" label * argument 1 to restores <program counter, stack, mask> * argument 2 used to set return value for sigsetjmp() * Call inside the handler as the last step * Must have called sigsetjmp() before calling siglongjmp() - 21 - 5.7 Controlling return place after handler Example: Handling SIGSEGV, SIGFPE void handler( sig int ) { /* code fragment */ siglongjmp(jmpbuf, 2); } void test() { int a = 0; a = a/ a ; /* SIGFPE */ } int main() { /* install handler for SIGFPE, SIGSEGV */ /* unmask SIGFPE, SIGSEGV */ switch (status = sigsetjmp(jmpbuf, 1) ) { case -1: exit(0); case 0 : test() ; case 2 : /* code after return from handler */ } } Ex. Program 5.2, pp. 192-3 * Q? Where do we return after int_handler()? * Q? What will the program print? * Q? Why use "jumpok" ? - 22 - 5.7 Unwinding the Stack objects on stack are destroyed * local variables, * local class objects destructors are called Program state (stack, mask) goes back to a previous state * global data may have changed * existing objects may have changed Issues * What recovery is possible? Can data be saved? * What dynamic memory items need to be released? * Can intermediate changes to global data be undone? - 23 - 5.7 Controlling return place after handler Alternatives ways for unwindi...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Sanford-Brown Institute - AM - 165
Sample Exam Problems, AM165, 6 Nov 2001: This rst seven problems below constitute a midterm exam that was given in a two hour period in the evening at about this point in the course syllabus. The last ve problems make up another midterm exam that was also
University of Toronto - CS - 364
qwtEtgaqwtXgVfEowXWIf9`fAEtgxqrfqW&quot;g! c u xw y W c WY p Y V x rY ph wa rY W V rY V xY yx ya ph x W w x w s V x c d T S xY x w W WYw rYa w f3tguW tgoGfdgw&amp;tgy&amp;scfw_qrgxdXw3&quot;&amp;fgyedgwXdXcgVfE3f l x h y V c u xw y W c WY p Y V hw yx V x wa tghtpxXwttdtgaXwtq
Austin Peay - CHEM - 1110
Exam 2 Review Sheet for Wednesday, March 3 Exam Chem 1120, Spring 04, RobertsonOur exam will include material from parts of chapters 13, 16, 17, and 18. Only material that I have covered in class, have assigned homework problems for or is mentioned on th
Stanford - JDSU - 1023
1 2 3 4 5 6 7 8 9 10 11 12 13JORDAN ETH (BAR NO. 121617) TERRI GARLAND (BAR NO. 169563) PHILIP T. BESIROF (BAR NO. 185053) MORRISON &amp; FOERSTER LLP 425 Market Street San Francisco, California 94105-2482 Telephone: 415.268.7000 Facsimile: 415.268.7522 Atto
Duke - CPS - 220
UltraSPARC T1: A 32-threaded CMP for ServersJames Laudon Distinguished Engineer Sun Microsystems james.laudon@sun.comOutline Server design issues &gt; Application demands &gt; System requirements Building a better server-oriented CMP &gt; Maximizing thread coun
CUNY Baruch - BIOL - 370
LECTURE 18: OLFACTION AND TASTEREQUIRED READING: Kandel text, Chapter 32Smell and Taste are the chemical senses Smell (olfaction) is the discriminating sensation of volatile chemical odorants by the olfactory system Taste is discriminating sensation of
Minnesota - CBS - 4125
BIOC 4125MOLECULAR BIOLOGY LABORATORY SITE-SPECIFIC MUTAGENESIS62The ability to introduce a mutation is indispensable for molecular research. It is essential for the probing of gene function and its regulation. The method you will use to introduce muta
Nevada - ERS - 322
Chapter 14: Wetlands and Land DrainageHomework: 2, 6, 7Due 19 NovemberWetlands:Once considered a nuisance, to be drained and farmed Now recognized for their value: Wildlife habitat Groundwater recharge Flood control Recreation A large percentage of we
LSU - APPL - 003
LOUIS-Cofumn7, Oo&amp;Wwy?Lisa Stigall, Column EditorEditor Stigall, Lisa Columnfz6w-/cewcIt has been a difficult Fall here in South Louisiana. Hurricanes Katrina and Rita interrupted the education of over 75,0001 higher education students, displaced fac
UC Riverside - A - 4378
Grade PostingWhat's okay? What's not okay?Q.Revised 9/08May examination results and final grades be posted for students to inspect near faculty offices or on department bulletin boards? The Registrar recommends using Blackboard to distribute student g
Berkeley - E - 140
Econ 140Multiple RegressionLecture 13Lecture 121Today's planEcon 140 Moving from the bi-variate to the multivariate Looking at how the multivariate equation relates to the bivariate equation Derivation The difference between true and estimated mode
East Los Angeles College - LW - 611
LL.M. in International Trade Law LW611 - Public International Trade (GATT/WTO) LawCourse Director: David M. Ong Half/One Unit course: First Term, 2006-7 Office: 5S7.29, tel: 87-2292, e-mail: daveo@essex.ac.uk Reading: The World Trade Organization: Law, P
University of Illinois, Urbana Champaign - PHYS - 550
Chapter 7The Brownian Dynamics Method AppliedContents7.1 7.2 7.3 7.4 7.5 7.6 Diusion in a Linear Potential . . . . . . . . Diusion in a Harmonic Potential . . . . . . Harmonic Potential with a Reactive Center Free Diusion in a Finite Domain . . . . . .
rh.edu - DSES - 6620
-General ReportOutput from D:\My Documents\rich\Homework 9\Burger queen merged.modDate: Mar/28/2002 Time: 05:29:15 PM-Scenario : Normal RunReplication : AllPeriod : Final Report (0 sec to 8 hr Elapsed: 8 hr)Simulation Time : 8 hr-LOCATIONS Aver
University of Illinois, Urbana Champaign - CS - 421
Sample questions for final, CS 421, Spring 2008 These questions cover material that may be on the final, and are at about the level of difficulty of the exam questions. However, there are some differences. We have not debugged them as carefully as the que
Midwestern State University - M - 300
A A Sample L TEX Document Math 300 October 11, 20061Typing TextA Since L TEX is a markup language, any text we type appears on the page, A unless it contains one of the nine reserved characters of L TEX, listed below.\ cfw_ &amp; _ ^ % ~ # If we want tho
Midwestern State University - EM - 4851
EM4851Volunteers and ExtensionThe authors are Janet H. Hiller, 4-H Youth Development Specialist, Washington State University Cooperative Extension, Pullman; and Jennifer Leach, Washington State University Cooperative Extension, 4-H Youth Development Age
Midwestern State University - HORT - 421
FTS-329 Sept. 26, 2007Fruit and Tree Nuts OutlookAgnes Perez and Susan Pollack2007 U.S. Production of Major Noncitrus Fruit Forecast Up Except for ApplesThe index of prices received by U.S. fruit and tree nut growers remained below a year ago in Augus
University of Rochester - PHYS - 221
Phys 221Today Friday Ch 28 Ch 28Lecture 31 OutlineSpecial Relativity 1 1/2 Special Rel. 2nd stApril 7th , 2004HW25Redo; HW 27 HW26Redo; HW 281Chapter 28: Special Relativity Introduction. Intuition, proes and cons. Modern Questions o Blackbody radi
Midwestern State University - EM - 2778
FRUIT PIE SCORECARDC0536FRUIT PIE SCORECARDC0536Examine exhibit for the qualities listed below. Place a check in the appropriate column to indicate the placing deserved. Exhibitor's Name (or No.) Product Entered Class Lot Ribbon No Placing County No.
Midwestern State University - C - 1091
WASHINGTON STATE 4-H DOG OBEDIENCE PROGRAM GRADUATE NOVICE SCORE SHEETSHOW_ DATE_C1091EEXHIBITOR NUMBER _JUDGE_ BREED _Exercise and Judge's Orders Heel Free &amp; Figure 8Forward Halt Left turn Right turn About turn Slow, Normal, Fast Exercise finished
Bates - PSYC - 101
Stress, Health &amp; Adjustment Psych 101 Stress Health Psychology o A field that studies the relationship between. Both _ and _ of illness are studied.Stress = o Healthy stress =How do you know you're stressed? o Three categories:Sources of Stress Two maj
UNF - CHEM - 3610
Inorganic Chemistry: Study Guide Exam 1Chapter 1 Fundamental particles of an atom Atomic number, mass number, notation Relative atomic mass and isotopes, weighted average mass spectroscopy and isotopes isotope and allotrope quantum theory/wave mechanics
twsu.edu - IE - 255
IEN255 Chapter 5 Annual Equivalent Worth Analysis Another common method Equal payments on an annual basis Convert NPW to AEEngineering EconomyAnnual Equivalent Worth Criterion AE(I) = PW(I)(A/P,I,N) (5.1)Engineering EconomyGood or bad? (for revenue)
Midwestern State University - CPTS - 443
CptS 443/580-Human-Computer InteractionSpring, 2008Assignment Option #1 Assessment Form1 forPerformance Criterion 1. Identifies appropriate artifacts 2. Clearly articulates conceptual models Level 1: Emerging (1-2 pts) Fails to identify one software ap
UMBC - DOCS - 345
System Design DocumentMay 12, 2001 Team ATable of Contents Introduction.2 Introduction:Purpose.2Introduction:Scope.3 Introduction:References.3 Introduction:Overview.3 Introduction:Constraints.3 System Overview.
Midwestern State University - AS - 473
AS 473/573 Term Papers Spring 2009Two field trip reports are required of all students. Both field trip reports will focus on the analysis of the dairy visited. Use these subject areas as subheadings: 1) Description of the facilities, an overview of the d
Midwestern State University - AS - 473
AS 473/573 McMahon's EZ AcresRichard McMahon founded McMahon's EZ Acres located in Homer, NY, in 1957. Dick raised his family of 10 children on the farm and built it into a world-respected Registered Holstein herd. This farm grew to 75 cows by the early
Idaho - FSTMMBB - 417
AOAC Ofcial Method 2002.07IntroductionTotal Plate Count Color IndicatorSimPlate Total Plate Count Color Indicator (TPC-CI) method is used for the detection and quantication of total aerobic microorganism populations. It is based on Binary Detection Tec
St. Mary NE - FRAME - 2219
MEDICAL FORM Please provide medical information on this form. RETURN COPY DIRECTLY TO ALEGENT Attn: CSM Student Files Alegent Bergan Mercy Occupational Health Services 7500 Mercy Road Omaha, NE 68124 402.398.6581 FAX: 402.398.6001 EMERGENCY PERMISSION Con
St. Mary NE - FRAME - 4388
FEDERAL DIRECT PARENT PLUS LOANThe Parent Loan for Undergraduate Students (PLUS) is offered through the William D. Ford Federal Direct Loan Program, which enables families to borrow directly from the federal government to pay college costs. Loan funds ar
St. Mary NE - FRAME - 4388
Express Center Financial Aid 7000 Mercy Road Omaha, NE 68106 (402) 399-2362Federal Direct Parent PLUS Loan Refund Release Form(Optional)Federal Direct Parent PLUS Loan funds will be applied directly to your daughters student account. If a credit balanc
St. Mary NE - FRAME - 2219
Nebraska Health and Human Services Adult/Child Protective Services Central RegistryRELEASE OF INFORMATIONI understand that as a condition of my enrollment in the School of Health Professions at College of Saint Mary, my name will be checked against the
St. Mary NE - FRAME - 4388
Consortium Agreement A consortium agreement is a written agreement between two schools. This agreement allows you to take courses at another institution and count those courses toward your degree at College of Saint Mary. College of Saint Mary is the inst
DePaul - IS - 421
IS 421 Information Systems AnalysisJames Nowotarski 14 October 2002Todays Objectives Recap basics of data modeling Understand more advanced data modeling concepts: Special types of entities Foreign keys Normalization (time permitting, intro only)Cour
University of Texas-Pan American - COBA - 6390
CHAPTER 15 Suggestions for Case AnalysisSTRATEGIC MANAGEMENT &amp; BUSINESS POLICY10THEDITIONTHOMAS L. WHEELEN J. DAVID HUNGERPrentice Hall, Inc. 200615-1Suggestions for Case AnalysisChecklist for Red Flags Cash flow from operations should exceed net
Minnesota - DELAG - 002
Module Delivery TasksProgramming and Related Tasks TaskDevelop Marketing Website Develop marketing sites. Add link to public registration URL.WhoCSHComments/Questions One site for professional modules and one for consumer modules. These are our curr
St. Mary NE - FRAME - 4544
7000 Mercy Road, Omaha, NE 68106 Ph: 402.399.2337Morning: CSI:CSM(JUNE 8-12, 2009, 8:00AM- 12:00PM)Afternoon: GREYS ANATOMY(JUNE 8-12, 2009 1:00PM 5:00PM)Registration form is for either CSI:CSM, Greys Anatomy or both. There is a $50 discount if you a
St. Mary NE - FRAME - 2219
Most Frequently Asked Fieldwork Questions The following information is also available on AOTA's Fax-On-Request Line 1-800701-7735; follow the voice mail prompts, and request item # 817. The purpose of this information is to provide you with answers to fre
St. Mary NE - FRAME - 4388
2009-2010 Verification Worksheet Federal Student Aid ProgramsYour Free Application for Federal Student Aid (FAFSA) was selected for review in a process called Verification. In this process, College of Saint Mary will compare information from your FAFSA w
St. Mary NE - FRAME - 4388
2009-2010 Verification Worksheet Federal Student Aid ProgramsYour Free Application for Federal Student Aid (FAFSA) was selected for review in a process called Verification. In this process, College of Saint Mary will be comparing information from your ap
St. Mary NE - FRAME - 2219
MEMORANDUM To: From: Assembly of Student Delegates Members Paul Grace, MS, CAE Chief Executive Officer National Board for Certification in Occupational Therapy (NBCOT) Certification Examination Information and ResourcesSubject:During the 2004 ASD Pre-Co
St. Mary NE - FRAME - 4388
Application for Federal Work Study 2009-2010 Name_ SSN _-_-_ Local Phone Number_ CSM E-Mail_ Major_ Did you attend CSM in 2008-2009? _Yes _No If yes, did you hold a work-study position in 2008-2009? _ Yes, and I would like to continue to work in the_. _ Y
St. Mary NE - FRAME - 4388
12009-2010 Professional Judgment Form for Unusual CircumstancesStudent Name_ Social Security #_The purpose of this form is to assist you in requesting a review of your financial aid eligibility due to changes in circumstances not addressed on your orig
St. Mary NE - FRAME - 4388
COLLEGE OF SAINT MARY SUMMER 2009 FINANCIAL AID APPLICATION(Please read carefully before completing)1. To be considered for summer financial aid, you must be accepted to College of Saint Mary as a degree or certificate-seeking student. If you are a new
Midwestern State University - C - 0074
EVALUATING ORAL REASONS SCORE CARD Class Contestant No. Placing Presentation (20) Grooming Posture Poise, confidence Eye contact Clear, audible voice English Organization (15) Introduction Logical order Conclusion Knowledge (40) Saw major strengths Saw we
Stanford - EEAP - 248
Chapter 4 Macroscopic ConductorsJ. B. Johnson (1927): Nature 119, 50 (1927) An open-circuit voltage noise spectral density Sv() is independent of the material and the measurement frequency, and is equal to 4kBTR.Rv(t) Microscopic theoryA. Einstein (1
twsu.edu - IE - 775
computerIntegratedmanufacturingLarry Whitmanwhitman@imfge.twsu.edu (316) 691-5907 (316) 978-3742Industrial &amp; Manufacturing Enterprise Department The Wichita State University http:/www.mrc.twsu.edu/whitman/classes/ie775cIm -IE775CIMMustbelinkedtostrat
Minnesota - LIUXX - 297
Math 2243 Practice Final Fall 2005(Instructors: S. Joo / M. Kurzke) Name: Discussion Session:(021: Javier Zuniga TTh 10:10, 022: Chung-I Ho TTh 10:10, 023: Javier Zuniga TTh 11:15, 024: Chung-I Ho TTh 11:15 031: Doyoon Kim TTh 2:30, 032: Javier Zuniga T
Minnesota - LIUXX - 297
MATH 2243: LINEAR ALGEBRA AND DIFFERENTIAL EQUATIONS SAMPLE FINAL EXAMINSTRUCTOR: SASHA VORONOVYou may not use a calculator, notes, books, etc. Only the exam paper and a pencil or pen may be kept on your desk during the test. You must show all work. Goo
Minnesota - LIUXX - 297
Math 2243, Practice Final exam. You will need a photo ID for the nal! Please let me know if you nd any errors in these solutions.Name: Instructor: Remember to show all your work. Without it, a correct answer may be given no credit. (1) Problem 1. Find th
Minnesota - LIUXX - 297
Math 2243, Practice Final exam.You will need a photo ID for the nal!Name: Instructor: Remember to show all your work. Without it, a correct answer may be given no credit. (1) Problem 1. Find the general solution y(t) to ty + 2y = 6t.(2) Problem 2. Find
Minnesota - LIUXX - 297
Minnesota - LIUXX - 297
Minnesota - LIUXX - 297
MATH 2243: LINEAR ALGEBRA AND DIFFERENTIAL EQUATIONS SAMPLE MIDTERM TEST IIINSTRUCTOR: SASHA VORONOVYou may not use a calculator, notes, books, etc. Only the exam paper and a pencil or pen may be kept on your desk during the test. Good luck! Problem 1.
Minnesota - LIUXX - 297
Midterm Exam IILast Name: First Name: ID:1234Section:Math 2243, March 24, 2004 There are 4 partial credit questions, each of them worth 25 points. NO GRAPHIC CALCULATORS are permitted. GOOD LUCK !21. Answer both of the following two questions : a
Minnesota - LIUXX - 297
Math 2243, Midterm Exam 2November 8, 2001INSTRUCTIONS: Books and notes are not allowed. Calculators are NOT allowed. Problems 1-3 are in multiple choice format. For these problems circle the answer you believe to be correct. Write complete solutions to
Minnesota - LIUXX - 297
Midterm Exam I1234Last Name: First Name: ID: Math 2243, February 16, 2004 There are 4 partial credit questions, each of them worth 25 points. NO GRAPHIC CALCULATORS are permitted. GOOD LUCK ! Section:21. Answer both of the following two questions :
Oklahoma State - PHYSC - 519
PHYSC 3513 FALL 2003HOMEWORK #10; Due Friday, November 21, 2003 Read Boas, Chapter 8, Sections 5, 6 Read Boas, Chapter 13, Sections 1-4 1. 2. 3. Boas, pages 358-360, # 5, 9, 35, 36 Boas, pages 366-367, # 5, 9, 11 Given the initial boundary value problem
Midwestern State University - MATH - 202
Midwestern State University - MATH - 201
A Math 201 - Test 2 Section: _ Group:_ Name:_Circle the correct answer on problems 1 and 9. Work will not be graded on these problems. On all other problems, show appropriate work to receive credit and place your answer in the blank provided. Point value