5. Monitor concept, synchronized principle, synchronized lock upgrade and examples (lightweight lock, heavyweight lock, spin lock, bias lock)

Monitor concept Java object header Take 32-bit virtual machine as an example Common object Array object The Mark Word structure is 64 bit virtual machine Mark Word reference material https://stackoverflow.com/questions/26357186/what-is-in-java-object-header Principle of Monitor (lock) Monitor is translated into monitor or tube Eac ...

Added by BK87 on Sat, 05 Mar 2022 21:29:30 +0200

Thread World in JAVA

Processes and ThreadsProcesses are the basic unit by which a program requests resources from the operating system, such as memory space and file handles.Threads are the smallest unit of independently executable execution in a process.JAVA Thread APICreating a thread in Java creates an instance of the Thread class.Each thread has its own task to ...

Added by dt192 on Sat, 05 Mar 2022 19:05:41 +0200

I wrote an implementation case of Java RMI (remote method call)

I simply wrote an implementation case of Java RMI (remote method call). In order to better understand RMI (remote method call), the meaning of serialization and so on, it took more than three days to build an implementation case of Java RMI. !!! High energy warning!!! The amount of code is a little large. A diagram is attached for understanding ...

Added by eruna on Sat, 05 Mar 2022 18:35:57 +0200

springboot integration jpa project entry level demo

springboot integration jpa project entry level demo preface1, Create an empty boot project2, Prepare the database, mainly MySQL3, Import dependency4, Generate JPA entities5, JPA basic notes6, JPQL and EntityManager7, Configuration file8, demo package preface Simple basic entry level, no fragrance if you have a foundation! 1, Create an empty ...

Added by phpmoron on Sat, 05 Mar 2022 17:46:11 +0200

[spring] spring integration Mybatis source code analysis

Brief introduction to spring integration Mybatis This article focuses on mybatis spring 1.3.2!The core idea of integration: become the Bean of spring.Implementation of integration: spring Based FactoryBean. Mybatis spring 1.3.2 integration idea Mappercannerregister class is imported through @ mappercan.The mappercannerregister class implemen ...

Added by Jordi_E on Sat, 05 Mar 2022 17:32:41 +0200

Maximum subarray sum (greedy algorithm and dynamic programming method)

Note that you are looking for a continuous array!! 1, Dynamic programming method class Solution { public int maxSubArray(int[] nums) { //Create an array dp as large as nums int[] dp=new int[nums.length]; //dp[i] represents the sum of the largest subarray of the array ending in num [i] dp[0]=nums[0]; ...

Added by unclemid on Sat, 05 Mar 2022 17:31:24 +0200

First JDBC program

JDBC 1: Database driven For example: sound card, graphics card, driver, etc; 2: JDBC In order to simplify the (unified database) operation of developers, SUN company provides a (Java database operation) specification, commonly known as JDBC. The implementation of these specifications is done by specific manufacturers. For developers, we onl ...

Added by andrin on Sat, 05 Mar 2022 17:12:12 +0200

[java framework] SpringBoot--SpringBoot implements asynchronous, email and scheduled tasks

1.SpringBoot integration task mechanism 1.1. Spring boot implements asynchronous methods Daily development involves many interactive responses between the interface and the back-end, which are not synchronous. Spring boot provides us with an annotation method to implement asynchronous methods. Make the request response of the front end and th ...

Added by duvys on Sat, 05 Mar 2022 16:09:27 +0200

For the addition, deletion, modification and query of a User table, I wrote nearly 200 lines of code

1, Basic version (including basic operation) This is the most common way of writing in our work RedisUtil: encapsulated Redis related API operationsRedisKeyPreConst: the key prefix involved in Redis cacheUserMapper: operation database The code implementation details are as follows: public class UserServiceImpl implements Use ...

Added by myraleen on Sat, 05 Mar 2022 16:04:56 +0200

Optional air judgment operation manual

We programmers do a lot of null value checking. Although sometimes this kind of inspection is completely unnecessary, we are used to routine. Finally, Java 8 couldn't stand it anymore, so we introduced Optional so that the code we wrote was no longer so mean and inflexible. Pull the name of a member from the database according to the member ID, ...

Added by akshay on Sat, 05 Mar 2022 14:56:12 +0200