TopBar

Archive for December, 2007

Summary of reading 2.5 chapter 2 for Unix™ Systems Programming: Communication, Concurrency, and Threads

0
December 17, 2007

After reading this section of chapter, I found that more and more things need to think a through at some time, especially for the guideline listed below.

  1. Make use of return values to communicate information and to make error trapping easy for the calling program.

  2. Do not exit from functions. Instead, return an error value to allow the calling program flexibility in handling the error.

  3. Make functions general but usable. (Sometimes these are conflicting goals.)

  4. Do not make unnecessary assumptions about sizes of buffers. (This is often hard to implement.)

  5. When it is necessary to use limits, use standard system-defined limits rather than arbitrary constants.

  6. Do not reinvent the wheel—use standard library functions when possible.

  7. Do not modify input parameter values unless it makes sense to do so.

  8. Do not use static variables or dynamic memory allocation if automatic allocation will do just as well.

  9. Analyze all the calls to the malloc family to make sure the program frees the memory that was allocated.

  10. Consider whether a function is ever called recursively or from a signal handler or from a thread. Functions with variables of static storage class may not behave in the desired way. (The error number can cause a big problem here.)

  11. Analyze the consequences of interruptions by signals.

  12. Carefully consider how the entire program terminates.

I can understand most but the not entries. I need more time to think about them. Just share the guide to you all. ^_^

VN:F [1.9.3_1094]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Posted in: programming |

[ebook]Minimal Perl for UNIX & Linux people. 2007.(MANNING)

0
December 12, 2007

Details

  • Paperback: 450 pages
  • Publisher: Manning Publications; 1 edition (October 1, 2006)
  • Language: English
  • ISBN-10: 1932394508
  • ISBN-13: 978-1932394504
  • Product Dimensions: 9.1 x 7.4 x 1.2 inches
  • [DownLoad Link]
VN:F [1.9.3_1094]
Rating: 4.0/10 (1 vote cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)

Posted in: books |