On Multithreading

1. Process? Thread? Multitasking? In fact, there are a lot of cool programs in each process, such as cool browser, cool video, and so on. The thread is a branch or phenomenon in the process, which is an independent execution path. A process includes at least one thread. Threads can be understood as improving the efficiency of program operation, ...

Posted by phparmy on Thu, 10 Feb 2022 03:38:38 +0100

Simple chat room (group chat + single chat) and Slider verification

Mengxin entering the pit (please comment in the comment area if you have any suggestions) This is the first article I published and the beginning of my entry into society. I firmly believe that as long as I work hard, I will become a big man in the future. (I will often publish some knowledge points and some small java projects in the futu ...

Posted by Agtronic on Thu, 10 Feb 2022 03:28:12 +0100

Rocketmqlrocketmq message consumption retry mechanism

1. Retry of sequential messages For sequential messages, when the consumer fails to consume the message, the message queue RocketMQ will automatically retry the message continuously (with an interval of 1 second). At this time, the application will be blocked in message consumption. Therefore, when using sequential messages, it is important to ...

Posted by baffled_in_UK on Thu, 10 Feb 2022 03:10:43 +0100

After reading this article, you can enter the big factory for real-time chat. The article makes it clear: chat server + chat client + Web management console.

catalogue   1, Foreword 2, Final effect 1. Chat server 2. Chat client 3. Web administration console 3, Demand analysis 4, Outline design 1. Technology selection 1) Chat server 2) Web administration console 3) Chat client 4)SpringBoot 5) Code construction 2. Database design 3. Communication design 1) Message protocol format 2) ...

Posted by tomhoad on Thu, 10 Feb 2022 02:12:53 +0100

Java JUC ThreadPoolExecutor parsing

Thread pool ThreadPoolExecutorintroduceThread pool mainly solves two problems: one is that thread pool can provide better performance when executing a large number of asynchronous tasks. When the thread pool is not used, a new thread is required to execute whenever a task needs to be executed. Frequent creation and destruction consume performan ...

Posted by gamblor01 on Thu, 10 Feb 2022 02:06:25 +0100

Java multithreaded learning sharing-4

Thread pool ThreadPoolExecutor 1, Constructor public ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, lockingQueue<Runnable> workQueue) { this(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, Executors.defaultThreadFactory ...

Posted by shimano55 on Thu, 10 Feb 2022 01:55:19 +0100

Deep understanding of Java enumeration mechanism

Before reading this article, you need to understand how to define enumeration and its simple use enumeration 1, How the JVM handles enumerations A simple enumeration class public enum Fruit{ APPLE(67),ORANGE(68),BANANA(69); int code; Fruit(int code){ this.code=code; } } Decompile fruit. Using the Jad command C ...

Posted by rjs on Thu, 10 Feb 2022 00:41:37 +0100

Boundless tutorial: introduction to Java 14 – Text block

In Java, a text block is a multiline string text. This means that we don't need to get into the mess of explicit line terminators, string joins, and separators, which are usually used to write ordinary string text. Java} text blocks are available in Java 13( JEP 355) and Java 14( JEP 368  )As a preview function. It is planned to become a st ...

Posted by KCKTechs on Thu, 10 Feb 2022 00:20:07 +0100

Java multithreading: take you to know different locks!

I Lock interface Lock interface is the foundation of everything. Its abstract class is a tool used to control the access of multiple threads to shared resources The following methods are provided to abstract the whole business: void lock()void lockInterruptibly() throws InterruptedException: breaks the lockboolean tryLock(): non blockin ...

Posted by PHP'er on Thu, 10 Feb 2022 00:05:11 +0100

Advanced Java - buffer stream, conversion stream, serialization stream, print stream

1, Buffer stream Buffer stream is also called efficient stream, which is an enhancement of four basic FileXxx streams. Therefore, it is also four streams, which are divided into: Byte buffer stream: BufferedInputStream,BufferedOutputStream Character buffer stream: BufferedReader,BufferedWriter Basic principle of buffer flow: When creating ...

Posted by FaT3oYCG on Wed, 09 Feb 2022 23:51:40 +0100