Reading notes for the 20th chapter 'Broadcasting' of unp.

2011-08-28  来源:本站原创  分类:Internet  人气:64 

We know that information transmission means through the Ethernet consist of unicasting, multicasting, anycasting and broadcasting. The following table show differen forms of addressing.

Type IPv4 IPv6 TCP UDP # IP interfaces identified # IP interfaces delivered to
Unicast . . . . One one
Anycast * . Not yet . A set one in set
Multicast opt . . A set All in set
broadcast . . All All

** The disadvantage of broadcasting

When a computer node A broadcasted information in application level, it will be tranlated into physical level with use the dest Enet = ff: ff: ff: ff: ff: ff to transmit. The all nodes that are in same subnet with A will recevie the datagram in physical level and translate it to high level. This means that the all computers in the subnet will cached the datagram until the high level such as transmission level to discard if the destination is not match. But in unicasting style, they will not cache the datagram at all if the destination is not match.

** Race codition

A / race condition / is usually when multiple processes are accessing data that is shared among them, but the correct outcome depends on the execution order of the processes.

Q: when a process is blocked at a function, a signal reaches which will interrupt the function. After the signal handler function return, will process return to execute that blocked function?

A: will not.

#include <stdio.h>
#include <signal.h>
#include <unistd.h>

static void do_alarm(int);
/* static had_alarm = 0; */

int main(){
        signal(SIGALRM, do_alarm);
        alarm(1);
        /* for( ; ; ){ */
/*              if(had_alarm == 1)
            break;
*/
                sleep(100);

                printf("Hello, world!\n");
                fflush(stdout);

        //}
        return 0;
}

static void do_alarm(int signo){
        printf("do alarm \n");
        fflush(stdout);
/*      had_alarm = 1; */
        return;
}

/*
 * When redirect the output to a file, the
 * string 'do alarm' will partly missing,
 * why? The reason is that i have not flush
 * the stdout buffer. when added fflush(stdout),
 * it works correctly.
 */

The above program will only exec 1 second which proves the above conclusion.

相关文章
  • Reading notes for the 20th chapter 'Broadcasting' of unp. 2011-08-28

    We know that information transmission means through the Ethernet consist of unicasting, multicasting, anycasting and broadcasting. The following table show differen forms of addressing. Type IPv4 IPv6 TCP UDP # IP interfaces identified # IP interface

  • Long Tail Theory Reading Notes: A Brief History Chapter Elliot 2010-04-11

    Elliot is the pinnacle of a series of business innovations, these innovations mainly in the production, supply, distribution and sale of goods methods, such as Internet shopping can be realized for all elements of non-Internet: Federal Express, Inter

  • Reading notes (Master joomla1.5 Chapter III The database01) 2010-07-06

    Joomla 1.5 db-schema: http://dev.joomla.org/downloads/Joomla15_DB-Schema.htm / / Network articles: http://qkzz.net/article/c0c7142f-2d5b-4808-933a-f648d9397ba8_2.htm Return result set loadResult / / return the first row, first field loadObject / / re

  • Reading notes (Master joomla1.5 Chapter III The database 02) 2010-07-06

    loadAssocList: public function test_loadAssocList () ( echo "loadAssocList: \ n"; $ This-> assertNotNull ($ this-> db); $ Query = "SELECT * FROM" . $ This-> db-> nameQuote ('#__ newsfeeds'); $ This-> db-> setQuery ($

  • Reading notes (Master joomla1.5 Chapter III The database 03) 2010-07-06

    loadObject: / / return an instance of stdClass class public function test_loadObject () ( $ Query = "SELECT name FROM" . $ This-> db-> nameQuote ('#__ users'); $ This-> db-> setQuery ($ query); print_r ($ this-> db-> loadObject

  • Reading notes (Master joomla1.5 Chapter The database: JTable 04) 2010-07-06

    The official interpretation of JTable / ** * Abstract Table class / / abstract table class personally think that is the parent class dao * * Parent classes to all tables. * * @ Abstract * @ Package Joomla.Framework * @ Subpackage Table * @ Since 1.0

  • Reading notes (Master joomla1.5 Chapter The database01) 2010-07-06

    Joomla 1.5 db-schema: http://dev.joomla.org/downloads/Joomla15_DB-Schema.htm / / Network articles: http://qkzz.net/article/c0c7142f-2d5b-4808-933a-f648d9397ba8_2.htm Return result set loadResult / / return the first row, first field loadObject / / re

  • Reading Notes: Enterprise JavaBeans, 3.0 Chapter 1. Introduction 2010-07-31

    Reading Notes: Enterprise JavaBeans, 3.0 Chapter 1. Introduction 1.1. Server-Side Components In business systems, object-oriented languages are used to improve development of GUIs, to simplify access to data, and to encapsulate the business logic. A

  • Reading notes on the code refactoring (1) 2010-04-16

    AgileJava reading notes (1) AgileJava is a test-driven development based on the method to help you learn how to polish your Java code, and thus obtain a stable object-oriented design and high-maintainable, high-quality systems. The book with a studen

  • javascript DOM programming arts reading notes 2010-09-06

    javascript DOM programming arts reading notes The first part of the directory Chapter 1 Origin of JavaScript 1.1 JavaScript 1.2 A Brief History of the browser war 1.3 standard 1.4 Summary Chapter 2, JavaScript 2.2 Grammar 2.1 Grammar 2.3 statement pr

  • JUnit In Action Reading Notes (1) 2008-03-29

    JUnit In Action Reading Notes (1) Part1 JUnit distilled chapter1 will teach you what the JUnit framework is and what problems it solves. chapter2 will take you on a discovery tour of the core JUnit classes and how to best use them. chapter3, you'll p

  • Reading notes (1) array 2010-05-04

    Reading notes 1. In c + +, there are two ways the array statements: one is to use the built-in array; Another is to use Vector. Vector is much easier to use and more secure than the basic element array, and should therefore be preferred to use Vector

  • <Software Architecture Design> reading notes notes 2010-05-07

    "Software Architecture Design" reading notes http://uptodate.javaeye.com/blog/346676 Domain model lack of knowledge, not in-depth understanding of Robustness analysis?

  • Reading Notes: Your First Cup: An Introduction to the Java EE Platform 2010-07-10

    Reading Notes: Your First Cup: An Introduction to the Java EE Platform 1. Differences Among Three platforms Java technology is both a programming language and a platform. The Java programming language is a high-level object-oriented language that has

  • Reading Notes explain design pattern mode (Interpreter pattern) 2010-10-28

    Interpreter Pattern: Given a language, define a representation of its grammar, and define an interpreter, the interpreter uses the representation to interpret sentences in the language. By the definition, does not explain the mode is a commonly used

  • Reading Notes: Based on fuzzy c-means algorithm for data classification and forecasting of space - Hu Caiping. Qin Xiaolin 2010-11-06

    Reading Notes: Based on fuzzy c-means algorithm for data classification and forecasting of space - Hucai Ping, Qin Xiaolin Background Introduction c-means c-means clustering method is the most common and most commonly used method, in the "Data Mining

  • Long Tail Theory Reading Notes: Chapter shelves battle 2010-04-11

    This chapter, we will return to power-law curve of the left, to talk about the shelf edge and cost. Successful Long Tail aggregators need both popular products and also require large popular products, they must be across the diversity spectrum, from

  • Long Tail Theory Reading Notes: Chapter II the rise and decline favorite 2010-04-11

    Before the industrial revolution, most of the culture is local. The rise of modern industry caused a wave of urbanization, making all kinds of people can come together. Commercial printing technology, photography, the phonograph's invention, inspired

  • Long Tail Theory Reading Notes: Chapter VII of the new fashion leader who 2010-04-11

    Once upon a time, made a star with a record only one way: broadcasting. MTV 80's came in the 20th century, became a favorite of the second manufacturing approach. But today, people spend money on advertising and advertising agencies have less confide

  • Long Tail Theory Reading Notes: Chapter tailed market 2010-04-11

    Network World has a strong power of word of mouth, and will combine together two things: First, unlimited shelf space, and second, the buying trends and public perceptions of the real-time information. Consumers can find the more the more they like w