1 / 20

What’s Not To Like?

http://syque.com/cstyle/contents.htm. What’s Not To Like?. Brace layout is probably the most noticeable element of the style of a C program.

lowri
Download Presentation

What’s Not To Like?

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. http://syque.com/cstyle/contents.htm What’s Not To Like? Operating Systems • Brace layout is probably the most noticeable element of the style of a C program. • It is arguable that braces are an 'unnecessary' part of the layout and that indentation alone is enough to show nesting. Against this is the argument that braces follow the principle of explicitness in laying out a block, clearly showing the start and the end. • There are several common styles of brace usage which can cause significant confusion if mixed! if ( LineStatus == LINE_OPEN ) { while ( CheckLineLevel() == LEVEL_OK ) { while ( (Ch = ReadLine()) != EOF ) { if ( Ch == CH_REVERSE) { ReverseLine(); } } } }

  2. Tip #5: Braces Operating Systems if ( PageWidth > PaperWidth ) { SetPageWidth( PaperWidth ); TellUser( MSG_PAGE_CHANGED ); } if ( PageWidth > PaperWidth || PageWidth < PG_MIN_WIDTH || IsNewDocument() ) { SetPageWidth( PaperWidth ); TellUser( MSG_PAGE_CHANGED ); } Kernel Style if ( PageWidth > PaperWidth ) { SetPageWidth( PaperWidth ); TellUser( MSG_PAGE_CHANGED ); } if ( PageWidth > PaperWidth || PageWidth < PG_MIN_WIDTH || IsNewDocument() ) { SetPageWidth( PaperWidth ); TellUser( MSG_PAGE_CHANGED ); } Allman Style if ( PageWidth > PaperWidth ) { SetPageWidth( PaperWidth ); TellUser( MSG_PAGE_CHANGED ); } if ( PageWidth > PaperWidth || PageWidth < PG_MIN_WIDTH || IsNewDocument() ) { SetPageWidth( PaperWidth ); TellUser( MSG_PAGE_CHANGED ); } Whitesmiths Style http://syque.com/cstyle/contents.htm

  3. Brace Styles Operating Systems

  4. Project 1 Signals Quiz Operating Systems • What is a signal? • Who can signal? • When is a signal acknowledged? • How are signals delivered to a process? • What operations are illegal within a signal handler? • How are parameters passed to a signal? • What signals might a process not handle? • How many signals might a system support?

  5. Project 1 Signals Quiz Operating Systems • What is a signal? • Who can signal? • When is a signal acknowledged? • How are signals delivered to a process? • What operations are illegal within a signal handler? • How are parameters passed to a signal? • What signals might a process not handle? • How many signals might a system support? An asynchronous notification of an event (software interrupt). Any process / call-back / interrupt. Pending signals processed before the process is rescheduled for execution. Via a signal variable in the process control block. Blocking operations (call-backs are not on the user stack). Via global variables (not thru function parameters). Harmless signals such as SIGSTOP. Maximum number of bits in process signal variable.

  6. Signals Signal Handling Operating Systems

  7. Operating Systems Operating Systems Overview Chapter 2

  8. Brief Look at the Evolution of OS Operating Systems • In the beginning… • There were no operating systems, • No programming languages or compilers, • No mice and no windows, • and the earth was without form, and void; and darkness was upon the face of the deep. • Suppose you built a computer. • How would you get it to read and run the programs that you will write? • How would it access devices: read input and write output data? • A program runs from memory, but one must get the program into memory somehow. How would you then run a different program? • Would you have to restart the computer? • How much does the program you write have know about your system’s hardware: the details of accessing a disk or scanning a keyboard? • Can this information be hidden from application programmers?

  9. The OS Evolution Operating Systems OS Complexity ENIAC 1940 1950 1960 1970 1980 1990 2000 2010 2020

  10. The OS Evolution Operating Systems • The transistor is on the list of IEEE milestones in electronics and Bardeen, Brattain, and Shockley shared the 1956 Nobel Prize in Physics for their achievement. OS Complexity ENIAC Transistor 1940 1950 1960 1970 1980 1990 2000 2010 2020

  11. The OS Evolution Operating Systems OS Complexity ENIAC EDSAC and EDVAC Transistor 1940 1950 1960 1970 1980 1990 2000 2010 2020

  12. The OS Evolution Operating Systems OS Complexity ENIAC EDSAC and EDVAC BINAC Transistor 1940 1950 1960 1970 1980 1990 2000 2010 2020

  13. The OS Evolution Operating Systems OS Complexity BINAC ENIAC UNIVAC EDSAC and EDVAC Transistor 1940 1950 1960 1970 1980 1990 2000 2010 2020

  14. The OS Evolution Operating Systems OS Complexity BINAC ENIAC UNIVAC IBM 701 EDSAC and EDVAC Transistor 1940 1950 1960 1970 1980 1990 2000 2010 2020

  15. The OS Evolution Operating Systems OS Complexity BINAC ENIAC UNIVAC IBM 701 UNIVAC 1103A EDSAC and EDVAC Transistor 1940 1950 1960 1970 1980 1990 2000 2010 2020

  16. The OS Evolution Operating Systems OS Complexity BINAC ENIAC UNIVAC IBM 701 UNIVAC 1103A FORTRAN EDSAC and EDVAC Transistor 1940 1950 1960 1970 1980 1990 2000 2010 2020

  17. The OS Evolution Operating Systems OS Complexity BINAC ENIAC UNIVAC IBM 701 UNIVAC 1103A FORTRAN Burroughs B5000 EDSAC and EDVAC Transistor 1940 1950 1960 1970 1980 1990 2000 2010 2020

  18. The OS Evolution Operating Systems OS Complexity BINAC ENIAC UNIVAC IBM 701 UNIVAC 1103A FORTRAN Burroughs B5000 IBM 7090 EDSAC and EDVAC Transistor 1940 1950 1960 1970 1980 1990 2000 2010 2020

  19. The OS Evolution Operating Systems OS Complexity BINAC ENIAC UNIVAC IBM 701 UNIVAC 1103A FORTRAN Burroughs B5000 IBM 7090 DEC PDP-1 EDSAC and EDVAC Transistor 1940 1950 1960 1970 1980 1990 2000 2010 2020

More Related