Use of wait/notify and J.U.C Condition in synchronized thread communication and source code analysis

I remember there was a classic interview question: how to output from 1 to 100 in sequence with multiple threads? The last chapter talked about the use and principle analysis of locks in Java. The above interview questions should be handy This chapter mainly talks about the realization of production and consumption queue and Condition source c ...

Posted on Mon, 06 Dec 2021 23:08:14 -0500 by GoodWill

Analysis of the Source+Expansion Mechanism of the Saintest Array List

1. Introduction to ArrayList At the bottom of the ArrayList is an array queue, which is equivalent to a dynamic array. Compared to arrays in Java, its capacity can grow dynamically. Applications can use the ensureCapacity operation to increase the capacity of ArrayList instances before adding a large number of elements. This reduces the number ...

Posted on Mon, 06 Dec 2021 12:20:50 -0500 by Nikos7

[code without size] implement a HashMap

Force deduction question This problem is on the power button Design hash mapping . If you think about it, it's very simple. Just design a simple HashMap class according to the design principle of hash table. A simple HashMap needs to support three methods: void put(K key, V value)V get(K key)void remove(K key) In order to implement the has ...

Posted on Mon, 29 Nov 2021 15:35:30 -0500 by Seraskier

Tools | pg_recovery design principle and source code interpretation

Author: Zhang Lianzhuang, PostgreSQL R & D EngineerHe has been engaged in the development of PostgreSQL database kernel for many years and has a very in-depth research on citus.Last issue We introduced the PostgreSQL data retrieval tool: pg_reconveryThis article will take you to understand PG_ The implementation principle and design idea of ...

Posted on Fri, 26 Nov 2021 06:42:02 -0500 by mystrymaster

What do you think of the source code of 7K Star's famous open source project?

Hello, I'm Pitang. Recently, a small partner in the programmer bus learning exchange group wants to know how to look at the source code. Recently, I have some experience and understanding. I also wrote an article on actually running through NaiveUI source code: How is the component library recommended by Youdu developed? Source code experience, ...

Posted on Thu, 25 Nov 2021 23:36:14 -0500 by showman

What do you think of the source code of 7K Star's famous open source project?

Hello, I'm Pitang. Recently, a small partner in the programmer bus learning exchange group wants to know how to look at the source code. Recently, I have some experience and understanding. I also wrote an article on actually running through NaiveUI source code: How is the component library recommended by Youdu developed? Source code experience, ...

Posted on Thu, 25 Nov 2021 18:16:19 -0500 by aboldock

Java-CopyOnWrite on Write

introduce Copy-on-write (COW) is an optimization strategy in the field of computer program design. Core Ideas Multiple callers read the same resource that the pointer points to. Only when the caller writes, copy a copy of the resource, and replace the old resource with the copy. application Linux uses COW technology to reduce Fork over ...

Posted on Wed, 24 Nov 2021 12:53:46 -0500 by lalomarquez

Java exception handling

Necessity Exceptions are not only an error control mechanism, but also a communication medium. Developing exception specifications enables everyone to understand common concepts and use them in the same way, and improves code readability and api usability. Before exception capture: Resource release/close put in finally or use try-with-re ...

Posted on Tue, 23 Nov 2021 18:00:15 -0500 by vexx

[JDK source code] 20000 word concurrent HashMap

Opening question (1) Is the data structure of ConcurrentHashMap the same as that of HashMap? (2) When does HashMap have concurrency security problems in a multithreaded environment? (3) How does concurrent HashMap solve the problem of concurrency security? (4) What locks does ConcurrentHashMap use? (5) How does the capacity expansion o ...

Posted on Mon, 22 Nov 2021 00:15:35 -0500 by argh2xxx

Qt Creator source code learning note 02, understanding the framework structure

It takes about 6 minutes to read this article After learning about the basic knowledge of Qt Creator in the previous article [^ 1], this article first learns the basic structure of the framework, so that you can clearly know the files, folders and project files contained in the framework, what they mean and what their functions are file str ...

Posted on Sat, 20 Nov 2021 23:08:29 -0500 by Ristiisa