Linux blocking and non-blocking

1. Introduction to blocking and non-blocking block non-blocking fd = open(“/dev/xxx_dev”, O_RDWR); //open file in blocking mode fd = open(“/dev/xxx_dev”, O_RDWR | O_NONBLOCK); /* open in non-blocking mode */ 2. Waiting queue 1. Waiting for the head of the queue The biggest advantage of blocking access is that when the device file is inoperable, the […]

SpringBoot integrates Redis, and understanding of cache penetration, cache avalanche, cache breakdown, how to add locks to solve the problem of cache breakdown? How to add distributed locks in distributed cases

Article directory 1. Steps 2. Specific process 1. Introduce pom dependencies 2. Modify the configuration file 3. Unit testing 4. Test results 3. Redis running status 4. Practical application in the project 5. Locking solves the problem of cache breakdown Code one (there is a problem) Code two (problem solving) 6. New questions 7. Distributed […]

Empty folders cannot be deleted and cannot be opened, “The item does not exist, please confirm the location of the item”, “The item is being opened and cannot be deleted”, “The file is damaged or has been moved and deleted” (multiple methods with graphic explanations, details Need to pay attention, and possible problems)

1. Preliminary summary – the situation that triggers this folder This file or folder that cannot be deleted is actually an ancestral bug of the Windows system that has not been fixed so far, so we need to deal with it through special means. Listening to my slow talk about his reasons may be helpful […]

ReentrantLock source code analysis

Foreword Note: The source code of this article comes from JDK11 ReentrantLock is a reentrant lock in Java, which can be used to replace the traditional synchronized keyword for thread synchronization. Here are some comparisons with the synchronized keyword: name implementation reentrancy interruption fairness Does it support timeout Release lock ReentrantLock Java API level , […]

Class variables, class methods, code blocks, abstract classes, interfaces, and inner classes

After learning about encapsulation, inheritance, and polymorphism in object-oriented programming, I recently came into contact with several new knowledge points. Sort it out here, help yourself to review, and also record my learning experience. 1. Class variables and class methods Instance objects of the same class only share a template prototype, and do not share […]

Executable Case of Non-Local Network under the Mindspore Framework

Executable case download: Non-Local notebook NonLocal “Non-local Neural Networks” was published in CVPR2018 as a method for processing action classification. Introduction to algorithm principles Figure 1 nonlocal_block NonLocal is a flexible building block that can be easily used with convolutional/recurrent layers. It can be added to the front part of the deep neural network, unlike […]

Grab the online video stream and save it locally, and take a screenshot of the video at the same time

Catch the online video stream and save it locally, and capture the video image at the same time package; import org.bytedeco.javacpp.avcodec; import org.bytedeco.javacv.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.annotation.Resource; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; /** * @ClassName testUrl1 * @Author dell-pc * @create 2023/3/9 […]