3 Pages

ipcstudy.sol

Course: CS 350, Fall 2009
School: W. Alabama
Rating:
 
 
 
 
 

Word Count: 620

Document Preview

350 CS Operating Systems Study Question Solutions 1 1. Interprocess Communication socket() creates a communications end point bind() assigns an address to an end point listen() informs the kernel that the end point will be used to accept new connections, and causes space to be allocated (in the kernel) for a queue of pending connections accept() is used to accept a new connection connect() is used to request...

Register Now

Unformatted Document Excerpt

Coursehero >> Alabama >> W. Alabama >> CS 350

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.
350 CS Operating Systems Study Question Solutions 1 1. Interprocess Communication socket() creates a communications end point bind() assigns an address to an end point listen() informs the kernel that the end point will be used to accept new connections, and causes space to be allocated (in the kernel) for a queue of pending connections accept() is used to accept a new connection connect() is used to request a new connection 2. The active process initiates the connection by naming a target address in a connect() call. Only the socket() and connect() calls are required in the active process. The passive process assigns an address to its socket and then waits for connection requests. It uses socket(), bind(), listen(), and accept(). 3. Datagram sockets are not connection-oriented, transmit messages of a xed maximum length, are support only unreliable, unordered delivery. Stream sockets are connection-oriented and do not provide message boundaries. They support reliable, ordered transmission. 4. Use two pipes: main() { int pipea[2],pipeb[2],pid; pipe(pipea); pipe(pipeb); pid = fork() if (pid == 0) { /* child process */ /* close one end of each pipe */ close(pipea[0]); close(pipeb[1]); /* remainder of child code here */ } else { /* parent process */ close(pipea[1]); close(pipeb[0]); /* remainder of parent code here */ }} 5. To connect the two sockets, accept() and connect() must be called. Since both are blocking calls, one process will not be able to call them both. 6. main { int d, ns[2], r, choose; char c; d = socket(STREAM); bind(d,mediator); listen(d); /* accept connections from both processes */ 1 ns[0] = accept(d); ns[1] = accept(d); /* choose is used to make the mediator fair */ choose = ns[0]; DO FOREVER BEGIN r = select(ns[0],ns[1]); IF (r = BOTH) THEN r = choose; IF (choose = ns[0]) THEN choose = ns[1]; ELSE choose = ns[0]; read(r,&c,1); write(r,x,1); read(r,&c,1); END } 7. relative to pipes: +: no to need have pipe created by common ancestor process -: access to data limited only by le system permissions (less control) -: need to worry about names: duplication, cleaning up old ones, etc. relative to sockets: +: simpler to establish connection -: limited to a single machine -: only simplex (one-way) communication is supported 8. If pipes are simplex, use two pipes per pair of processes, one for communication in each direction. Since there are three distinct pairs of processes, six pipes will be needed. They must be created by the parent. 9. int amt; int ps,cs,s,ns; //socket desriptors char c,buf[N ]; //N is a positive constant s = socket(STREAM); bind(s,address-of-R); listen(s,2); // accept a connection ns = accept(s); // read one character from the connection read(ns,&c,1); // determine whether our connection is to P or C if (c == p) then ps=ns else cs=ns; ns = accept(s); read(ns,&c,1); if (c == p) then ps=ns else cs=ns; do forever { //read at most N bytes from the producer amt = read(ps,buf,N ); //write what we read to the consumer write(cs,buf,amt); } 10. The server needs to have one socket for each client, i.e., N sockets. In addi...

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:

W. Alabama - ECE - 605
NOTES ON PROBABILITY AND STOCHASTIC PROCESSESRavi R. Mazumdar School of Electrical and Computer Engineering Purdue University West Lafayette, USA Autumn 200211c Copyrighted materialChapter 1Introduction and Overview of ProbabilityThis cha
W. Alabama - CHE - 031
DEPARTMENT OF CHEMICAL ENGINEERING Ch.E. 031 Process Flowsheeting Assignment #9 P Purpose: To illustrate a process optimization application at the o operations stage. T The Process: A 15 stage distillation column with a side-draw stream is fed with a
W. Alabama - CHE - 031
DEPARTMENT OF CHEMICAL ENGINEERING Ch.E. 031 Process Flowsheeting Assignment #10 P Purpose: 1 1. 2. To illustrate a process optimization application. To familiarize you with the input language for the AspenPlus optimization package, (see course notes
W. Alabama - NE - 113
Linear Algebra LABS Toolbox By: David R. Hill Mathematics Department Temple UniversityAn M-file supplement for MATLAB to accompany Linear Algebra
Charleston Law - MA - 670
Charleston Law - MA - 470
W. Alabama - STAT - 304
CS 316 Tutorial OneObject: To sign on and run a short Sas ProgramBefore entering the Cygnus lab (MC3005), make sure to you have your userid and password. Without this information, you will not be able to log into the workstations. For the purposes
Charleston Law - BU - 692
Canadas Relative Standard of Living is FallingCanadas GDP/Capita$28,100 $29,400 Differential: US$1300GDP/Capita ($US at Purchasing Power Parity)$18,4501990 Third in the World2000 Sixth in the World2000 As if ThirdSource: OECD Main Accou
W. Alabama - ECE - 428
Assignment 5 solutions Compute Networking:1. Look at the second duplicate packet in Fig. 6-11(b). When that packet arrives, it wouldbe a disaster if acknowledgements to y were still floating around. 2. Deadlocks are possible. For example, a packet
W. Alabama - ECE - 316
1Solutions to the selected problems of Chapter 3Problem 14 Let: V=the event that the selected person has voted I=the event that the selected person is an Independent L=the event that the selected person is a Liberal C=the event that the selected
W. Alabama - ECE - 428
AdvantagesDisadvantages1. The same plaintext block will result in the same ciphertext block, making cryptanalysis very easy. 2. It requires an entire 64-bit block to arrive before decryption can begin. It may be unsuitable for some applications, f
UC Davis - EEC - 273
D y U S e c S o U u i G o G u e G t D D g b G D D D D vtv6HV 6$R6TaRxHPu "3RHT3q Pu P G g g S X S F V U e o U n D r D U F U V U u C q p p c c o e G g U n c i g S e G m S V g b G D D u Hasa6xW6gHa65d$HHH$dE33Ht6aRa5$A6aX T6H3RH
W. Alabama - CS - 848
Topics covered Review of complexityCS848: Topics in Databases: Foundations of Query OptimizationTuring machines (TMs)Formally define our notion computability. They consist of: an arbitrarily large tape, a finite tape alphabet, and a finite s
W. Alabama - CS - 744
CS 744 Programming Assignment 1 Due May 21, 20031. Download the RAG attribute grammar tool and sample applications at: plg/~gvcormac/cs744/rag Create a directory and save rag.tar and ragapp.tar in the directory.
W. Alabama - CS - 744
Redundancy OptimizationsConstant Folding Copy Propagation Dead Code Elimination Common Subexpression Elimination Value NumberingConstant Foldinga = 1; b = 2; c = a + b;c = 3;Do constant propagation dataow analysis Whenever a variable is con
W. Alabama - CS - 448
Hash-Based IndexesChapter 11Database Management Systems 3ed, R. Ramakrishnan and J. GehrkeIntroductionAs for any index, 3 alternatives for data entries k*: Data record with key value k <k, rid of data record with search key value k> <k, li
W. Alabama - CS - 447
ECE 453 CS 447 SE 465 Software Testing & Quality AssuranceLecture 32-33Instructor Paulo alencar1Overview Software Maintenance, Quality and Reuse Inspection Standards Process Maturity and Improvement2Typical Inspection Process Entry The
W. Alabama - CS - 330
Canadian Privacy LawsMaria CaroneIntroductionThe Personal Information and Electronic Documents Act (PIPEDA) will apply to all businesses operating in Canada unless they are provincially regulated and their province has a privacy law of its own th
W. Alabama - SYDE - 312
SyDe312 (Winter 2006) Unit 3 - Curve-Ftting Solutions Problem 5.8-1.Scatter plot of data for data set 1 and 2 are depicted in Fig. 1 (a) and (b) respectively. Logarithm of y1 versus x and logarithm of y1 versus logarithm of x are depicted in Fig. 2
W. Alabama - SD - 652
Systems Design 652 Assignment 2 Due 26 February 2009[1]: The quick-return mechanism consists of a crank AB, slider block B, and slotted link CD.Y DABA 30oB 30oXCDC300 mm AB = 100 mmIf the crank has a constant angular speed of 2 r
W. Alabama - HLTH - 102
Hlth 102 Module CAddiction aka Alcohol and Drug use in Society1Sandra BullockNo not the actress! Assistant Professor in Health Studies and Gerontology Post Doc and Research Associate at Stockholm University, Sweden PhD, MSc in Public Health Sci
W. Alabama - BIOL - 240
Lecture 1817.6 Thermococcales and Methanopyrus 17.7 The Archaeoglobales 17.9 Habitats and Energy Metabolism of Crenarchaeotes 17.10 Hyperthermophiles from Terrestrial Volcanic Habitatsphylogenetic tree of the ArchaeaThermococcales: hyperthermop
W. Alabama - AFM - 371
Notice for AFM 371 Students Regarding Midterm #2 March 13, 20081. The midterm will be held on Friday March 14 from 4:30 p.m. to 6:00 p.m. in RCH 302. 2. The School of Accounting and Finance has recently begun using a randomized seating procedure to
W. Alabama - AFM - 371
Notice for AFM 371 Students Regarding Midterm #1 February 5, 20081. The midterm will be held on Friday February 8 from 4:30 p.m. to 6:00 p.m. in RCH 302. 2. The School of Accounting and Finance has recently begun using a randomized seating procedur
W. Alabama - AFM - 271
Notice for AFM 271 Students Regarding Midterm #1 May 24, 20051. The midterm will be held on Friday May 27 from 4:30 p.m. to 6:00 p.m. in RCH 301 and RCH 305. 2. The midterm is worth 20% of your overall grade in the course. 3. The midterm consists o
W. Alabama - BIOLOGY - 447
Part One Report of the Walkerton Inquiry147Section 5(2) Notice Appendix I (i)Notice of Alleged Misconduct(Public Inquiries Act, s-s.5(2)Pursuant to subsection 5(2) of the Public Inquiries Act, you are notified that in its report(s), the Comm
W. Alabama - BIOLOGY - 447
Part One Report of the Walkerton Inquiry59Notice of Standing Hearing Appendix E (i)Notice of HearingMr. Justice Dennis OConnor has been appointed as the Commissioner of the Walkerton Inquiry. In Part I the Commission will inquire into the circ
W. Alabama - BIOLOGY - 447
Part One Report of the Walkerton Inquiry179Closing Submissions Notice Appendix L (i)May 24, 2001Notice to Parties in Part IClosing SubmissionsThe Commissioner looks forward to detailed closing submissions from the parties and anticipates t
W. Alabama - BIOLOGY - 447
Part One Report of the Walkerton Inquiry185Closing Submissions Funding Notice #1 Appendix L (iii)April 6, 2001Notice to Parties with Funding in Part IFunding for Closing SubmissionsWe have received a number of inquiries with respect to fun
W. Alabama - BIOLOGY - 447
Part One Report of the Walkerton Inquiry187Closing Submissions Funding Notice #2 Appendix L (iv)June 26, 2001Notice to Parties with Funding in Part IFunding for Closing SubmissionsOn April 6, 2001, you were advised of funding allotments fo
W. Alabama - BIOLOGY - 447
United States Environmental Protection AgencyOffice of Research and Development Washington DC 20460EPA/600/R-96/087 August 1996BIOSCREENNatural Attenuation Decision Support System Users Manual Version 1.3EPA/600/R-96/087 August 1996BIOSCRE
W. Alabama - BIOLOGY - 447
Part One: A SummaryReport of the Walkerton Inquiry:The Events of May 2000 and Related IssuesThe Honourable Dennis R. O'ConnorPublished by Ontario Ministry of the Attorney General Queen's Printer for Ontario 2002Cover Design: Tania Craan Des
W. Alabama - BIOLOGY - 447
Part One Report of the Walkerton Inquiry121Search Warrant Appendix H (ii)Search Warrant(Public Inquiries Act, R.S.O. 1990, c. P. 41, as amended, Form 3) TO: Inspector Craig Hannaford, Royal Canadian Mounted Police, Constable Marc Bolduc, Mr. Do
W. Alabama - BIOLOGY - 447
Part One Report of the Walkerton Inquiry45Letter Re: Standing Appendix D (iii)August 18, 2000Re: Standing for Part I of the Walkerton InquiryIn response to a number of requests, we set out below further information with respect to standing f
W. Alabama - BWV - 512
Chorale setting "Gib dich zufrieden und sei stille" in E minorJohann Sebastian Bach BWV 512Public DomainSheet music from www. MutopiaProject .org Free to download, with the freedom to distribute, modify and perform. Typeset using www. LilyPond .
W. Alabama - CS - 452
Intel x86 ArchitectureCS452/652 Real-Time Programming Course NotesDaniel M. Berry, Cheriton School of Computer Science University of Waterloo 2007 Daniel M. Berry 2007 Daniel M. BerryRegisters Segmentation Global Descriptor TableReal-Time Pr
W. Alabama - CS - 349
Scripting and User Interfaces CS 349Professor Terry July 12, 2006Today's Agenda Announcements Affine transforms, computing angles Scripting and user interfaces Class evaluationsCS349 / 2Announcements Assignment 4 is posted on the webCS
W. Alabama - MATH - 336
PMath 336: Introduction to Group TheoryExercise set 5June 9, 2008Solution should be submitted by the end of the Monday lecture of the following week, either in class or in the submission box. You may not submit joint or identical works.Notati
W. Alabama - MATH - 336
PMath 336: Introduction to Group TheoryExercise set 11July 24, 2008Solution should be submitted by the end of the Monday lecture of the following week, either in class or in the submission box. You may not submit joint or identical works.Nota
W. Alabama - MATH - 336
PMath 336: Introduction to Group TheoryExercise set 6June 19, 2008These are practice exercises for the second midterm. They should not be submitted.NotationGLn (S): Invertible n n matrices with coecients in S, under multiplication Dn : The
W. Alabama - MATH - 336
PMath 336: Introduction to Group TheoryExercise set 4June 6, 2008Solution should be submitted by the end of the Monday lecture of the following week, either in class or in the submission box. You may not submit joint or identical works.Notati
W. Alabama - MATH - 336
PMath 336: Introduction to Group TheoryExercise set 1May 12, 2008Solution should be submitted by the end of the Monday lecture of the following week, either in class or in the submission box. You may not submit joint or identical works. 1. (6 p
W. Alabama - MATH - 336
PMath 336: Introduction to Group TheoryExercise set 2May 23, 2008Solution should be submitted by the end of the Monday lecture of the following week, either in class or in the submission box. You may not submit joint or identical works.Notati
W. Alabama - MATH - 336
PMath 336: Introduction to Group TheoryExercise set 10July 21, 2008Solution should be submitted by the end of the Monday lecture of the following week, either in class or in the submission box. You may not submit joint or identical works.Nota
W. Alabama - MATH - 336
PMath 336: Introduction to Group TheoryExercise set 3May 27, 2008This is a collection of review questions for the first midterm, taken from the book. The midterm will consist of several questions of similar type and scope. This assignment shoul
W. Alabama - MATH - 336
PMath 336: Introduction to Group TheoryExercise set 8June 29, 2008Solution should be submitted by the end of the Monday lecture of the following week, either in class or in the submission box. You may not submit joint or identical works.Notat
W. Alabama - CO - 437
MODULE 12Economic Considerations for CO2 Storage(S. Wong)Economic feasibility is an important aspect of CO2 capture and storage projects. This becomes all the more complicated when many players are involved in a single CO2 capture and storageLE
W. Alabama - EARTH - 437
MBDCIRock StrengthMaurice DusseaultRock StrengthMBDCICommon Symbols in RM E, : Youngs modulus, Poissons ratio , , : Porosity, density, unit weight c, ,To: Cohesion, friction , tensile strength T, p, po: Temperature, pressure, in
W. Alabama - EARTH - 437
Rock and Rockmass PropertiesLecture 4 Earth 691B: Rock Engineering Materials used with kind permission of Dr Jean Hutchison, Queens UD.J. Hutchison - 2000Rockmass StrengthHutchinson and Diederichs, 1996Hutchinson, 2000Relative Properties Str
W. Alabama - CS - 350
THIS PAGE MUST BE ATTACHED TO THE COVER OF THE ASSIGNMENT THAT YOU HAND IN. BE CERTAIN TO PROVIDE THE NAMES AND UNIX USERIDS OF ALL GROUP MEMBERS, IN ADDITION TO THE GROUP NUMBER.CS350 Assignment 1 Marking Summary/Cover SheetGroup Number: Names an
W. Alabama - CS - 350
CS350 Assignment 2 Marking Summary/Cover SheetGroup Number: Marker:Group Members (Names AND Unix IDs): Design (30 Marks): Document the following items including a short description of each item, how you implemented it and the reasoning behind your
W. Alabama - CS - 350
CS350 Assignment 2 Marking Summary/Cover SheetGroup Number: Marker:Group Members (Names AND Unix IDs): Design (30 Marks): Document the following items including a short description of each item, how you implemented it and the reasoning behind your
East Los Angeles College - ACE - 2141
TestingHow do you ensure that your database does what its specification requires? General testing covers: Unit testing Queries, Macros, Screens, Reports System testing All Units work correctly together (Integration testing Interface testing P
W. Alabama - SYDE - 361
W. Alabama - SYDE - 361
11Electrical Engineering11.1 11.2 Introduction Fundamentals of Electric CircuitsElectric Power and Sign Convention Circuit Elements and Their i-v Characteristics Resistance and Ohm's Law Practical Voltage and Current Sources Measuring Devices
W. Alabama - SYDE - 181
W. Alabama - BWV - 1068
Air ('on the G string')from the Orchestral Suite no. 3 BMV 1068J.S. Bach (1685 - 1750)Flute2Guitar0351.72.9Public Domain21113151618Sheet music from www. MutopiaProject .org Free to download, with the freedom to di
W. Alabama - BWVANH - 131
AirJohann Sebastian Bach (1685-1750) BWV Anh. 131mffpfCreative Commons Attribution-ShareAlike 2.5Sheet music from www. MutopiaProject .org Free to download, with the freedom to distribute, modify and perform. Typeset using www. LilyPond
W. Alabama - BWV - 796
Sinfonia 10Johann Sebastian Bach BWV 7963 4 3 4471013Public Domain21619222528331Sheet music from www. MutopiaProject .org Free to download, with the freedom to distribute, modify and perform. Typeset using www. LilyPon
W. Alabama - BWV - 781
Invention 10Johann Sebastian Bach (1685-1750) BWV 7819 8 9 859131721Public Domain22529Sheet music from www. MutopiaProject .org Free to download, with the freedom to distribute, modify and perform. Typeset using www. LilyPond .
W. Alabama - BWV - 803
1Duetto IIfrom the Clavier bung Part III uJ.S.Bach (1685-1750)BWV 803 2 42 47121722Public Domain22732374247Mutopia-2003/10/08-36035358636873Mutopia-2003/10/08-36047883889499Mutopia-2003/10/08