• Common auxiliary classes


    CountDownLatch Subtraction counter import java.util.concurrent.CountDownLatch; //Counter public class CountDownLatchDemo { public static void main(String[] args) throws InterruptedException { //The total number is 6. It can be used when the task must be performed CountDownLatch countDownLatch = new CountDownLatch(6); for (int i = 0; i < 6; i++) { new Thread(()->{ System.out.println(Thread.currentThread().getName()+” Go out”); countDownLatch.countDown(); },String.valueOf(i)).start(); […]

  • Go language: sync package control concurrency details!


    In addition to the channel channel introduced in the previous section, there are also original synchronization mechanisms such as sync. Mutex and sync. Waitgroup to achieve more flexible data synchronization and control concurrency. Resource competition The so-called resource competition means that in a program, the same block of memory is accessed by multiple goroutines at […]

  • “Understand java” – why be afraid of concurrency, tools to help!


    Hello, I’m a side dish.A hope can becomeTalking about architecture with ox xMy man! If you want to be the person I want to be, or pay attention and be a partner, so that the dishes are no longer lonely! This paper mainly introducesNecessary concurrent tools for brick moving It’s all here. I’m ordering to […]

  • Simple understanding of various asynchronous process control methods of JavaScript


    Original address:http://zodiacg.net/2015/08/javascript-async-control-flow/ With the gradual maturity of ES6 standard, the topic of using promise and generator to solve callback hell problem has been very popular. However, it is still difficult to understand the various tools to solve the problem of process control / callback. In the past two days, I have read many articles and […]

  • Analysis of current limiting


    preface Each system has a processing peak when doing pressure test. When it is close to the peak and continues to accept requests, the whole system will respond slowly; In order to protect the system, we need to refuse to handle the overload request. This is the current limiting that we will introduce below. We […]

  • An interesting solution: do not use the background and JS, just CSS to reverse the number of a list, what would you do?


    By Manuel matuzovicTranslator: XiaozhiSource: matuzo Like again, wechat searchGreat migration to the worldPay attention to this person who does not have a big factory background, but has an upward positive attitude. this paperGitHub https://github.com/qq44924588…It has been included in the book, the articles have been classified, and a lot of my documents and tutorial materials have […]

  • [flutter 1-5] the first item to run flutter — counter


    Create project There are many ways to create a flutter project, and all ide tools integrate shortcut operations to create a flutter project. Here we list three ways: using the command line to create, using Android studio to create and using vscode to create. Using the command line to create After the installation of flutter, […]

  • Learn go and rust through examples — closure


    A closure, in short, is a piece of stateful code. Let’s try to make a counter with closures. Each time we call, the state of closures will be increased by 1 Go func intSeq() func() int { i := 0 return func() int { i++ return i } } func main() { nextInt := intSeq() […]

  • High performance mysql (version 3)_ Website click counter


    Website visits statistics, their own ideas:Whenever a user visits a page, the front-end initialization method automatically calls the back-end interface for access statistics. A counter table can be created separately. Using an independent table can help avoid query cache failure. udpate hit_counter set cnt=cnt+1 ; But when a large number of users visit the website […]

  • The interviewer asked: what is the solution to prevent duplicate requests?


    background In normal development, we often face the problem of preventing duplicate requests. When the server response to the request involves data modification or state change, it may cause great harm. The consequences of repeated requests are especially serious in the transaction system, after-sales rights protection and payment system. But most of the time, they […]

  • Use of flutter geTx — simple charm!


    preface When using bloc, there is a problem that I care about so far. I can’t really interact across pages! After consulting the official documents repeatedly, we use a global bloc to realize the “pseudo” cross page interactionflutter_ Analysis of bloc usage; fish_ Redux’s broadcast mechanism can perfectly realize cross page interaction. I also wrote […]

  • Have to understand the series of current limiting


    Brief introduction of current limiting Now when it comes to high availability systems, we will talk about high availability protection means: caching, degradation and current limiting. This blog mainly talks about current limiting. Current limiting is the abbreviation of rate limit, which means that only specified events are allowed to enter the system, and the […]