2 days for memo

Source: Internet
Author: User
1.
CPU depletion

After using OpenMP parallelism to process numeric operations, the CPU capacity will be exhausted, resulting in 100% of usage.

The CMP decompression module uses OpenMP.

On the Ningbo WallProgramWhy is CPU occupied?

High-performance development

Parallel Computing of CPU: OpenMP, Mpi, TBB, and mapreduce (this sounds like the most so-called cloud computing)

Gpgpu: cuda, opencl

Long long and Longlong

Long long in Win32 is the basic type,DWORDIt is also defined as this type. But Longlong is actually_ Int64.

Sprintf outputs long using the format character % lD, while Longlong is % i64d.

2.

In IPv4, both TCP and UDP require the client to specify the IP address and port number of the server. The server also needs to specify the IP address and port number of the listening client.

The data structure is sockaddr_in.

Struct socaddr_in

{

Short sin_family ;//SetAf_inet, Specifying that you are usingIPAddress Family

U_short sin_port ;//Port Number

Struct in_addr sin_addr; // ipAddress,Unsigned long inet_addr (const char far * CP)

Char sin_zero [8]; //

}

The inet_addr () function is used to convert an IP string to an unsigned long integer IP address.

Unsigned long inet_addr (const char far * CP)

Byte order. Most CPUs such as intel86 use the Small Header method. The byte sequence defined in Internet standards is the bulk method. There are eight APIs for converting host bytes and network bytes, from host to net and from net to host. The following are four hosts to net.

 

U_long htonl (u_long hostlong );

Int wsahtonl (

Socket s,

U_long hostlong,

U_long far * lpnetlong;

}

U_short htons (u_short hostshort );

Int wsahtons (

Socket s,

U_short hostshort,

U_short far * lpnetshort;

};

Socket Type: sock_stream (TCP/IP) and sock_dgram (UDP/IP ).

SOCKET protocol, ipproto_tcp, and ipproto_udp.

Accept failed

The accept function will pass in the length of sockaddr. The length value must be initialized to a correct value.

For example, if sockaddr_in ADDR is defined, int Len = sizeof (ADDR ).

Send failed

Sending fails unexpectedly. The reason is that the tcpserver thread has exited.

In the server test project, the accept () function is followed by return. Once a client is connected, accept returns. The server project to be tested is exited.

Why does it show that the slave master has a sequence?

Wsaemsgsize

The data received by the stream transmission protocol is buffered without the wsaemsgsize.

This error occurs if the data in UDP exceeds the buffer size.

 

 

 

 

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.