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 […]
Tag: loc
Byte Two: Tell me about your understanding of MySQL locking?
I saw in the group yesterday that everyone was discussing a MySQL lock issue, which is to execute the select … for update statement. If the query condition does not have an index field, should I add a “row lock” or a “table lock”? If you have done this experiment, you will find that when […]
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 […]
Using a database to implement a local blocking queue
I learned the technology when I was doing development at Huawei. I was doing content review in the content management team and found that they used local queues. At that time, I asked the project manager of the company why they didn’t use mq. His answer was “One application can only use 5 Queues, we […]
Use the interface to transfer the local jar package to the nexus warehouse
Table of Contents background Optimization 1. Use the interface call result 2. Use the mvn command to manually push (the password needs to be configured in the setting file, see the setting file at the top of the article for details) Summarize Background At present, we need to write some code in the parent pom […]
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 […]