A brief analysis of the internal workflow of notifyDataSetChanged

First of all, we know that notifyDataSetChanged is a method of Adater. It is mainly used to notify ListView and tell it that the data of Adapter has changed and the display of ListView needs to be updated. Therefore, when the data content of Adapter changes, notifyDataSetChanged() method will be called. Take a look directly […]

2023.10.17 Use of wait and notify and understanding CountDownLatch

Table of Contents Introduction Usage of method Introducing an instance (wait version without parameters) wait method execution process wait and notify combined example wait version with parameters The difference between notify and notifyAll Classic examples Summary CountDownLatch Introduction The biggest problem with threads is preemptive execution and random scheduling Although thread scheduling in the kernel […]

Rsync remote synchronization & inotify monitoring

Introduction to Rsync rsync (Remote Sync) is an open source fast backup tool that can mirror and synchronize the entire directory tree between different hosts, support incremental backup, and maintain links and permissions. In a remote synchronization task,the client responsible for initiating rsync synchronization operations is called the initiator, and the server responsible for responding […]

rsync backup tool (with rsync+inotify real-time synchronization deployment example)

rsync backup tool (with rsync + inotify real-time synchronization deployment example) 1. Overview of rsync 1.1 About rsync 1.2 Characteristics of rsync 1.3 Working principle 2. rsync related commands 2.1 Basic formats and common options 2.2 Start and shut down the rsync service 2.3 Basic format of downlink synchronization 2.4 Basic format of uplink synchronization […]

wait-notify and protective pause design

wait-notify A brief introduction to the principle Simply understand the picture below: Monitor The monitor is actually the object of the synchronized lock. In Java, each object can be associated with a Monitor object, and its instance is stored in the heap. Thread-2 A certain thread is now the Owner of the Monitor, that is, […]

rsync backup tool (with rsync+inotify real-time synchronization deployment example)

rsync 1. Overview of rsync 1.1 About rsync 1.2 Features of rsync 1.3 Working principle 2. rsync related commands 2.1 Basic format and common options 2.2 Start and shut down the rsync service 2.3 Basic format of downlink synchronization 2.4 Basic format of upstream synchronization 2.4 No interaction 2.4.1 Specify password file 2.4.2rsync-daemon method 2.4.3 […]

rsync remote synchronization + inotify monitoring

Table of Contents 1. Introduction to rsync: 2. Principle of rsync copying: 3. rsync synchronization method: 4. Basic format: 1. Commonly used options: 2. Two methods of synchronization: 3. Interaction-free format configuration: 5. Configure rsync source server: 1. Preparation: 2. Write configuration file: 3. Create a data password file for the backup account: 4. Add […]

rsync+inotify real-time data synchronization

1. Related introduction 1. rsync (remote synchronize) rsync is a remote data synchronization tool under Liunx/Unix. It can quickly synchronize files and directories between multiple hosts through LAN/WAN. There are generally two ways to synchronize files between Linux, namely rsync and scp. scp is equivalent to copying and pasting. If the file does not exist, […]

Java multi-threaded programming-inter-thread collaboration wait/notify

Foreword: This article is based on my personal understanding of Chapter 5 of “Java Multi-Threaded Programming Practical Guide – Core Chapter”. The source code is excerpted from the author’s source code, and my own understanding will be added to the source code. The reading notes are currently being updated by the author as follows: “Java […]