Common knowledge points

Source: Internet
Author: User

1. Methods of inter-process communication

Named pipes, Sockets, semaphores, FIFO, shared memory.

2. Process: A running program that is the smallest unit of system allocation resources

Thread: is a lightweight process, it has no system resources, is the smallest unit of system scheduling, a process is composed of one or more threads, within a process, multiple threads of resources are shared.

The difference between a process and a thread

Resource allocations are different: processes have separate memory and system resources, and within a process, resources between threads are shared, and system resources are not assigned to threads.

The productivity is different: The process switch needs to keep the system resources, while the thread switching does not need to keep the system resources, and improves the concurrency of the data processing.

Execution in different ways: The thread has a program to run the entry address, but the thread is running independently, because the thread does not occupy system resources, so the thread must exist in the process, the process can be directly dispatched by the operating system, the thread resources between different processes can not be shared.

3.GDB Commissioning

Adding debug information at compile time

Gcc-g Test.c-o Test

Then debug with GDB

GDB test

List: Listing code

Run: Running the program

N: Single statement execution

Continue (c): continuation of the implementation

Break 5: Add a breakpoint to line fifth

Break function1: Add a breakpoint at the function function1

Info B: View breakpoint information

P I: Print the value of I

BT: Print stack information

4. View assembly code

Start by adding debug information

Gcc-g Test.x-o Test

Then use Objdump to view the assembly code

Objdump-s Test

5.secureCRT cannot be entered to check if the rts/cts option is removed from the connection configuration

6.PC and virtual machines after you set up the shared directory, view the shared files under/mnt/hgfs/.

Fix u disk on 7.pc: Chkdsk h:/f

H is the Upan drive letter, when the system is not recognized, can be formatted in the phone settings

Segmentation of large files in 8.linux

For example, the 10G file.tar.gz is divided into 10 1G small files

Split-b 1G file.tar.gz new-file.tar.gz.

-b Specifies the split size, K, M, g units

File.tar.gz the file to be split

new-file.tar.gz. split file (note that there is a point ".") ), if you do not specify the item, the default is to Aa,ab,ac to split the file

Extract the split file

First use the cat command to synthesize a large file of the split file: Cat new-file.tar.gz.* > big-file.tar.gz

Then use the tar command to extract

If you are compressing and splitting together, you can use the pipe "|"

Tar-czvf-file | Split-b 1g-new-file.tar.gz.

Notice there are two "-" in the middle.

File is to be compressed.

Common knowledge points

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.