socket programming of OSI layer 7, TCP/IP layer 5, UDP and TCP (server and client), byte order conversion, implementation of multi process and multi-threaded server

1. The network is divided by coverage: LAN / man / WAN, Internet / Internet, Ethernet / token ring - networking mode 2. Each host must be represented by one in the network to realize point-to-point accurate communication IP address: ipv4: uint32_t unsigned 4-byte integer} DHCP/NAT} ipv6: uint_t addr[16]; Each data in network communication mu ...

Posted by VanHagar on Fri, 14 Jan 2022 05:03:31 +0100

ThreadLocal usage and full source code analysis

1. ThreadLocal introduction 1.1 official introduction From the description in the official Java document: the ThreadLocal class is used to provide local variables inside the thread. When this variable is accessed in a multithreaded environment (through get and set methods), it can ensure that the variables of each thread are relatively in ...

Posted by derksj on Fri, 14 Jan 2022 00:26:23 +0100

The Gaode interviewer asked me: can the service run after the JVM memory overflows? I have a smooth operation

At the beginning of the article, let's ask a question. If OOM occurs in one thread of a java program, can other threads in the process still run? Next, do an experiment to see if the six kinds of JVM programs can be accessed after OOM. Here I use a springboot program. /** * @author : charon * @date : Created in 2021/5/17 8:30 * @descripti ...

Posted by PrivatePile on Thu, 13 Jan 2022 21:07:50 +0100

Near data processing (NDP) -- the secret of improving the performance of GaussDB(for MySQL)

Absrtact: the deep integration of cloud stack is the key to releasing the power of cloud database. Huawei cloud is in a leading position in achieving this goal, as proved by GaussDB(for MySQL). This article is shared from Huawei cloud community< Near data processing (NDP), crowning the performance improvement of GaussDB(for MySQL) >, auth ...

Posted by preston_stone on Thu, 13 Jan 2022 04:43:05 +0100

Detailed explanation of java thread pool ThreadPoolExecutor class -- common task queue

In Alibaba java development manual, it is written that thread pools are not allowed to be created using Executors, but through ThreadPoolExecutor. The disadvantages of thread pool objects returned by Executors are as follows: 1) FixedThreadPool and SingleThreadPool: The allowed request queue length is integer MAX_ Value, which may accumulate a ...

Posted by lapith on Mon, 10 Jan 2022 22:03:05 +0100

linux processes and threads

process Basic concepts Process is a dynamic process of a program, and it is also the smallest unit of program execution and resource management allocation. Process lifecycle Create - > schedule - > execute - > die Process status: ready, running, blocked, etc. Three elements of process 1. Program (instruction and data) 2. Virtual m ...

Posted by SL-Cowsrule on Sun, 09 Jan 2022 10:26:13 +0100

Linux thread synchronization

Linux thread synchronization 1. Mutual exclusion Ensure that only one thread accesses data at a time. pthread_mutex_t mut; //Two initialization methods mut = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_init(&mut, NULL); 1. Initialization int pthread_mutex_init (pthread_mutex_t *__mutex, const pthread_mutexat ...

Posted by br on Sat, 08 Jan 2022 12:20:23 +0100

The third task of Python advanced training (winter vacation)

Multithreading Distinction between threads and processes 1. Thread is the smallest unit of program execution, and process is the smallest unit of resources allocated by the operating system 2. A process is composed of one or more threads. Threads are different execution routes of code in a process 3. Processes are independent of each other, b ...

Posted by legohead6 on Sat, 08 Jan 2022 06:10:13 +0100

JUC concurrent programming --- thread pool, parallel computing ForkJoin, asynchronous callback FutureTask and completable future

JUC notes JUC concurrent programming (I) - multithreading review, Synchronized and Lock locks, Condition thread communication, eight Lock problemJUC concurrent programming (II) - set insecurity and solutions under concurrency, read-write lock, blocking queue 10. Callable review Details: Multithreaded pickup The difference between Cal ...

Posted by Arnerd on Fri, 07 Jan 2022 20:56:51 +0100

CountDownLatch introduction

1, What is CountDownLatch? CountDownLatch is a synchronization tool class in Java util. In the current package, it is a tool class commonly used in JUC programming, allowing one or more threads to wait until other threads are running.    its implementation is simply to give a specified value to the timer during initialization t ...

Posted by PHPnewb_JavaAdept on Wed, 05 Jan 2022 11:21:47 +0100