Understanding the basic concepts of timeline

Source: Internet
Author: User

I.BytesUnderstanding

Failover is a facility for inter-process communication, but it is not a simple 1-1 Relationship Between processes. If there are many mature technologies that can be used: from simple COM, MPs queue, and Memory sharing to complicated CORBA in windows. Pipeline is more lightweight IPC, which can not only implement 1-1, but also implement IPC with 1-N relationships. It is object-oriented, just like using object-oriented language for IPC development. Introduce concepts such as object and interface.

2. start to understand the concept of the idea from the code of the pipeline.

1. bus: If a network composed of a hub and several machines is a bus-type network, we will not look at this network from the network extension theory, physically, It is a bus network: The Hub is a bus, and machines can communicate with this bus. The ingress is such a network, and the bus is equivalent to a hub, and the role actually played in the ingress system is the ingress-daemon.

2. Connecting connection. A connection represents a connection to the bus. In the hub network, each endpoint needs to communicate with each other and must be connected to the hub through a network cable. In the worker system, if a process needs to communicate with other processes, it also needs to connect to secure-daemon through the established connection, but this is a TCP connection. Let's take a look at the pipeline code for getting a connection:

If (! Init_connections_unlocked ())

{

_ Dbus_unlock (bus );

_ Dbus_set_oom (error );

Return NULL;

}

/* We want to use the activation address even if

* Activating bus is the session or system bus,

* Per the spec.

*/

Address_type = type;


/* Use the real type of the activation bus for getting its

* Connection, but only if the real type's address is available. (If

* The activating bus isn' t a well-known bus then

* Activation_bus_type = dbus_bus_starter)

*/

If (type = dbus_bus_starter &&

Bus_connection_addresses [activation_bus_type]! = NULL)

Type = activation_bus_type;


If (! Private & bus_connections [type]! = NULL)

{

Connection = bus_connections [type];

Dbus_connection_ref (connection );



_ Dbus_unlock (bus );

Return connection;

}

Address = bus_connection_addresses [address_type];

If (address = NULL)

{

Dbus_set_error (error, dbus_error_failed,

"Unable to determine the address of the message bus (try 'man login-launch' and 'man login-daemon 'for help )");

_ Dbus_unlock (bus );

Return NULL;

}

If (private)

Connection = dbus_connection_open_private (address, error );

Else

Connection = dbus_connection_open (address, error );

This is a piece of code in the dbus-bus.c internal_bus_get function, where dbusconnection is obtained. There are three types of persistent connection: dbus_bus_session, dbus_bus_system, dbus_bus_starter, and init_connections_unlocked functions. These three connections are created and saved in the bus_connections array. Read them directly from the array again, it can be seen that no process has only one connection to the bus.

There are two types of persistent connection: server connection that provides services and client connection that uses other connection services. Each established connection has a unique name. The client connection name is automatically assigned by the established connection, and the server connection name is obtained.Well-known names. In this way, the client connection can communicate with the server connection through this name.

3. Objects

A dedicated connection can provide multiple services, and objects can be understood as each service. The communication between objects is based on objects. Only two objects form an Enpoint-Enpoint communication.

4. Proxies

The program accesses an object through proxies, but some bindings may hide this concept, such as Java binding. In glib binding, all access to objects is performed through proxies.

Dbus_g_proxy_new in glib binding is used to create a proxy. Calling the dubs method API: dbus_g_proxy_call_no_reply also requires dbusgproxy as the parameter.

5. Methods

The functions provided by the object can be called by other worker processes. They are completely object-oriented and easy to understand ~

6. Signals

The signal provided by the object, which is understood as the callback provided by the object ~

From: http://hi.baidu.com/ljc_9449/blog/item/1cf7318334ddbdb66c8119de.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.