[Comprehensive explanation of Linux commands] 120. Master the badblocks command and check hard disk bad sectors in time

Article directory badblocks Additional information grammar Options parameter Example other Learn `python` from scratch badblocks Find corrupted blocks on disk Supplementary instructions The badblock command is used to find damaged blocks on the disk. The hard disk is a wear-and-tear device, and physical failures such as bad sectors may occur after being used for a […]

Go Concurrency Programming – Locks and Concurrency Safety

Mutex and RWMutex Mutex (mutex) and RWMutex (read-write mutex) are synchronization primitives commonly used in concurrent programming to control multiple threads’ access to shared resources. Mutex is an exclusive lock that provides exclusive access to shared resources. When a thread obtains the Mutex, other threads cannot obtain the Mutex and can only wait for the […]

Enable block verification checksum on PG or HGDB

Hangao Database Directory Environment Document Purpose Details Environment System platform: Linux x86-64 Red Hat Enterprise Linux 7 Version: 14,N/A Document Purpose Purpose Use checksum to provide block verification for the database to discover hidden block corruption problems. Note that it only applies to native PG or HGDB Enterprise Edition, or HGDB Security Edition that does […]

System Programming Three: Signal Processing + Signal Blocking Properties

1. Function interface about signals 1. How to send a signal to another process? (kill) Order kill – signal value ID number of the process killall – signal value process name function kill – send signal to a process //Send a signal to a process SYNOPSIS #include #include int kill(pid_t pid, int sig); parameter: pid: […]

Multi-threaded JUC Season 2 synchronized lock upgrade process

An overview of synchronized 1.1 Features of synchronized Using locks can achieve data security, but it will cause performance degradation. Synchronized is a heavyweight lock, and the lock upgrade process is:No lock -> Biased lock -> Lightweight lock -> Heavyweight lock. When concurrency is high, synchronization calls should try to consider the performance loss of […]

Linux Common Clock Framework (CCF)

Directory Preface Introduction to CCF The concept of provider and consumer CCF framework composition relationship CCF program key structure Important components of CCF Register clock Clock registration operation not using device tree Using the clock registration operation of the device tree Device tree analysis and usage clocks analysis example The name of the clock output […]

Writing custom controls in Qt – Halo Clock

1. Preface In the previous article, I wrote a high imitation of the halo calendar for the WIN10 system. This time I will draw a halo clock, which is also the effect seen on some web pages. The hours, minutes and seconds are drawn in the form of a progress bar, and This progress bar […]

3 implementations of distributed locks! Attached implementation code

Distributed lock is a technology used to ensure that multiple processes or threads in a distributed system access shared resources synchronously. At the same time, it is a common question in interviews, so this article will focus on the specific implementation of distributed locks (including implementation code). In a distributed system, data inconsistency may occur […]

[Redis] Redis implements distributed locks

【Redis】Redis common interview questions (1) Article directory 【Redis】Redis common interview questions (1) 1. Why use distributed locks? 2. How Redis implements distributed locks 3. Redis accepts multiple requests simulation demonstration 4. What are the problems with using Redis to implement distributed locks? 4.1 A lock is occupied for a long time 4.2 Lock deleted by […]

How to implement distributed locks

Directory title What is a distributed lock Implemented based on MySQL database table question Implementation based on database exclusive lock Implementing distributed locks with zookeeper SETNX implementation based on Redis Using etcd to implement distributed locks Distributed lock selection What is a distributed lock Distributed locks refer to locks set by each node of a […]