In the previous demonstration example of blog network programming (3), the simplest code flow of TCP has been introduced. This chapter expands on this basis:
First, the server can continuously receive messages from the client, and the client can also send messages to the server repeatedly;
After that, continue to improve the server, simply use ...
Cache mechanism under Mybatis concurrency
Mybatis level 1 and level 2 cache
Level 1 cache: It is enabled by default. For multiple identical operations in a session, only the first time will go to the database to query, and then directly go to the cache to get the data! 1. Query the record for the first time, and write the queried data into th ...
Posted by miramichiphoto on Mon, 16 May 2022 18:49:30 +0300
In java programming, we often call Thread The sleep () method makes the Thread stop running for a period of time, and the Thread class also provides the interrupt method for us to actively interrupt a Thread. So what is the essence of Thread hang and interrupt? This paper makes an exploration on this issue.
This paper is mainly divided ...
Posted by markmusicman on Sat, 07 May 2022 13:23:15 +0300
In Go, to understand channel, you need to know goroutine first.
1, Why goroutine
Modern operating systems provide us with three basic methods of constructing concurrent programs: multi process, I/O multiplexing and multithreading. Among them, the simplest construction method is multi process, but for multi process concurrent programs, due to ...
Posted by capslock118 on Fri, 06 May 2022 01:37:04 +0300
Thread asynchronous model Each thread executes its own and has nothing to do with each other. For example, there are two threads, one is for the younger brother to eat, and the other is for the elder sister to watch TV. Neither one affects the other.
thread synchronization model In my understanding, there is some kind o ...
Posted by xzazx on Tue, 03 May 2022 07:27:00 +0300
Producer consumer model
In the thread world, the producer is the thread of production data, and the consumer is the thread of consumption data. In multi-threaded development, if the processing speed of the producer is very fast and the processing speed of the consumer is very slow, the producer must wait for the consumer to finish processing b ...
Posted by Mightywayne on Sun, 01 May 2022 14:28:50 +0300
In the last article, we introduced a basic execution process of thread pool Thread pool necessary for [Java Concurrent Programming] interview And its seven core parameters, the role of each parameter, and how to use the thread pool
There are still a few small problems left.. I suggest you read the previous article before reading th ...
Posted by stickynote427 on Fri, 29 Apr 2022 06:35:30 +0300
1. Problems caused by sharing
1.1 critical zone
There is no problem for a program to run multiple threadsThe problem is that multiple threads access shared resources (1) There is no problem for multiple threads to read shared resources (2) When multiple threads read and write to shared resources, instruction interleaving occurs, which wil ...
Posted by cheesehead on Mon, 25 Apr 2022 06:32:31 +0300
Java multithreading programming skills are widely used in the code of Spring, Netty, Mybatis and other frameworks. Whether concurrent programming is appropriate or not will directly affect the performance of the architecture. Through the analysis of the source code of these frameworks and the common skills of concurrent programming, this paper ...
Posted by tomsasse on Sat, 23 Apr 2022 09:35:00 +0300
Thread and process overview
1.1 overview of JUC
JUC is Java util. The abbreviation of concurrent toolkit is the toolkit for processing threads.
1.2 process and thread
Process: refers to an application running on the system. Once the program runs, it is a process; Process - the smallest unit of resource allocation.
Thread: the basic unit in ...
Posted by ozzmans on Thu, 21 Apr 2022 19:58:33 +0300