A thousand miles without accumulating points (1)

Source: Internet
Author: User

A thousand miles without accumulating points (1)
1. What is your understanding of object-oriented technology?
Everything is an object, which improves code reusability compared with process-oriented programming. The three important features of object-oriented are encapsulation, inheritance, and polymorphism, which improves the flexibility and robustness of the system. The accessibility of attributes and methods in Object-Oriented enhances the security of the program, the diversity of data retrieval.

 

2. The process is inactive.. A process never executes anything. It is just a thread container. A thread is always created in a process environment, and its entire life cycle is in the process. A single process may contain several threads, all of which execute code in the process address space "simultaneously. A thread is the basic unit of cpu allocation.

 

3. Differences and connections between threads and processes. What is "thread security "?
(1) If the purpose of introducing processes in the operating system is to enable concurrent execution of multiple programs to improve resource utilization and system throughput. Then, introduce threads in the operating system to reduce the space overhead of the Program During Concurrent execution, so that the OS has better concurrency. Processes are the basic units that possess system resources, and also the basic units that can be independently scheduled and assigned (threads are also ). Generally, a process contains multiple threads and provides resources for them.
(2) thread security: if multiple threads run simultaneously in the process where your code is located, these threads may run the code at the same time. If the result of each running is the same as that of a single thread, and the value of other variables is the same as expected, it is thread-safe. In other words, the interface provided by a class or program is an atomic operation for a thread or the switching between multiple threads does not lead to ambiguity in the execution result of this interface, that is to say, we do not need to consider synchronization issues.

 

4. What is the difference between how C ++ allocates and releases memory?
C: malloc free // The function calloc () Will initialize realloc and reset the size

C ++: new delete // Operator

In C ++, the memory is divided into five zones: the free storage zone in the constant zone of the stack global/static zone (also known as the Code zone)

Malloc and free are standard library functions in C ++/C, and new/delete are operators in C ++. They can be used to apply for dynamic memory and release memory.

For non-Internal data objects, using malloc/free alone cannot meet the requirements of dynamic objects. The constructor must be automatically executed when the object is created, and the Destructor must be automatically executed before the object is extinct. Because

Malloc/free is a library function rather than an operator. It is not controlled by the compiler and cannot impose the execution of constructor and destructor tasks on malloc/free.


 

5. SOAP is a very popular protocol for information exchange on the Internet.Because it works in concert with HTTP, SMTP, and other similar protocols, it is very simple. The information described in it can be easily sent to another computer over the Internet, without the need to worry about being intercepted by network security technologies such as firewalls.

 

6. The program counter is used to store the address of the unit where the next instruction is located.

When executing an instruction, you must first obtain the instruction from the memory to the instruction register based on the instruction address stored in the PC. This process is called "instruction fetch ". At the same time, the address in the PC is automatically added with 1 or the address of the next instruction is given by the transfer pointer. After that, the command is analyzed and executed. Execute the First Command, and then extract the address of the second command based on the PC. In this loop, execute each command.


7. Instruction Register IR (Instruction Register) is a Register for temporarily placing program instructions obtained from memory.

 

8. Public Key and private key and authentication and signature
The private key is used for decryption and signature.
The Public Key is disclosed by myself and used for encryption and signature verification. It is used by others.

When a user sends a file, the user uses the private key to sign the file and others use the public key to decrypt the file. This ensures that the information is sent by the user. That is, digital signature.
When the user accepts a file, another user uses his/her public key to encrypt the file. He/she decrypts the file with his/her private key to ensure that the information can only be received by the user. You can avoid being seen by others.

 

9. NAT-Network Address Translation refers to the conversion of private network addresses (such as the enterprise Intranet) to public addresses (such as the Internet ),This hides the IP addresses managed internally. In this way, you can use non-registered IP addresses internally and convert them into a small number of externally registered IP addresses, this reduces the cost of IP Address Registration and saves the address space (IPV4) that is increasingly lacking ). At the same time, this also hides the internal network structure, thus reducing the risk of internal network attacks


10. The length of the array must be static. The Global Array allocates space for the Data Segment during system initialization.If the array size is not clear, the data segment cannot allocate space for it, because other data needs to be allocated space in the data segment. When creating a function call stack, the local variable array must also specify the size of the array, because local variables allocate space at the bottom of the stack, if the array size is unknown, the subsequent growth of the stack will not know where to start. Generally, this requirement is applied for dynamic memory temporarily as needed.


11. The computer "port" is a translation of the English port, which can be considered as an exit for communication between the computer and the outside world.The ports can be divided into virtual ports and physical ports. The virtual ports are the ports inside the computer or the vswitch router, which are invisible. For example, port 80, port 21, and port 23 on a computer. Physical ports, also known as logical ports, are visible ports, RJ45 network ports on the computer backplane, and RJ45 ports such as vro hubs. The telephone use of the plug-in is also a physical port.


12. The original meaning of Socket is "hole" or "Socket ".As the process Communication Mechanism of bsd unix, take the latter meaning. It is also called "socket". It is used to describe the IP address and port and is a communication chain handle. Hosts on the Internet generally run multiple service software and provide several services at the same time. Each service opens a Socket and binds it to a port. Different ports correspond to different services. Socket is like a porous Socket, just as it was originally intended. A host is like a room with various sockets. Each socket has a serial number. Some sockets provide 220 v ac, some provide 110 v ac, and some provide cable TV programs. The customer software inserts the plug into a socket with different numbers to obtain different services.

13. BIOS is the acronyms of "Basic Input Output System"After literal translation, the Chinese name is "Basic Input and Output System ". In fact, it is a set of programs solidified on a ROM chip on the motherboard in the computer, it stores the most important basic computer input and output programs, system settings, post-boot self-check programs, and system self-start programs. Its main function is to provide computers with the most underlying and direct hardware settings and control.


14. Operating System (OS)It is used to manage all hardware resources of a computer system, including software resources and data resources, control program running, improve human-machine interfaces, and provide support for other application software, so that all resources of the computer system can play a maximum role, provides users with convenient, effective, and friendly service interfaces.

 

 

 


 

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.