• Implementation of golang concurrent programming


    go The execution of the main function itself is a coroutine. When the go keyword is used, a new coroutine is created channel Channel pipe, used to pass signals between multiple coroutines No cache pipeline When writing to a bufferless channel, it blocks until a coprocessor reads the buffered channel Blocking scenario: There is no […]

  • Principle analysis of Java Concurrent copyonwrite container


    This article mainly introduces the principle analysis of Java Concurrent copyonwrite container. The example code is introduced in detail in this article, which has a certain reference value for your study or work. You can refer to the following for your friends Copy on write, or cow for short, is an optimization strategy used in […]

  • Detailed explanation of how to deal with concurrent timeout in go language


    Implementation principle: Concurrent a function, wait for 1s, and then write data to timeoutselectIf there is data to other within 1schannelIf not, this istimeoutWrite the data, then we know the timeout. Implementation code: package main import “fmt” import “time” func main() { ch := make(chan int, 1) timeout := make(chan bool, 1) //Execute a function […]

  • Java Concurrency: redis + Lua practice of distributed application current limiting


    Any current restriction is not aimless, nor can it be solved by a switch. The commonly used current restriction algorithms are token bucket and leaky bucket. I mentioned it in the previous article, but it is based on the single machine scenario. Previous article: interface current limiting algorithm: leaky bucket algorithm & token bucket algorithm […]

  • The way of PHP concurrent IO programming


    Concurrent IO has always been a technical problem in server-side programming, from the earliest synchronous blocking direct fork process, to the worker process pool / thread pool, to the current asynchronous IO and cooperation. Because PHP programmers have a strong lamp framework, they know little about this kind of underlying knowledge. The purpose of this […]

  • On the concurrency mechanism of go language


    A big advantage of go language over Java is that it can write concurrent programs conveniently. Goroutine mechanism is built in go language. Using goroutine, concurrent programs can be developed quickly and multi-core processor resources can be better utilized. This paper studies the application and scheduling implementation of goroutine. 1、 Go language’s support for concurrency […]

  • [the road to full stack] java basic course 4: producer consumer issues (20190614v1.1)


    Welcome to java basic course Blog address: https://segmentfault.com/a/11This series of articles will mainly focus on some basic knowledge points of Java, which are summarized in ordinary times. No matter you are new to Java development rookie or senior people in the industry, you hope to bring some help to your peers. If you have any […]

  • Lua web rapid development guide (7) – efficient interface call – httpc Library


    Httpc library is based on HTTP client library written by socket which is implemented in CF framework The httpc library has built-in SSL support, which enables you to request third-party interfaces without using a proxy Httpc supports header, args, body and timeout request settings, and perfectly supports various httpc call modes API introduction Httpc library […]

  • A method of downloading multiple files simultaneously in golang


    Background notes Suppose there is a distributed file system. Now we need to download some files from the system to the local machine. The IP address of some nodes of the file system and the list of file fileid to download are known, and the download address can be spliced through these information. The node […]

  • A method of parallel Ping of hosts in golang


    Using the good support of golang for high concurrency, write one IP line to pinglist.txt file in the same directory In fact, this function can be done with one command of Linux: cat pinglist.txt | xargs -P 10 -I {} ping -fc 100 {} package main import ( “bufio” “bytes” “fmt” “io” “io/ioutil” “log” “os” […]

  • Axios. All() solves concurrent requests


    Introduction:axios.all()、axios.spread()Two auxiliary functions are used to process multiple requests sent at the same time, which can implement some logic after multiple requests are completed. Note: this method isaxiosStatic method, notaxiosInstance method! First downloadaxios npm install axios –sava-dev staymina.jsIntroduce inaxiosBecause it does not belong tovueFamily bucket, so it’s attached tovueOn the prototype, realize global use main.js […]

  • Work record > > solution to prevent swipe of login SMS verification code


    I. write in the front In the history of Internet development, security is always a hot topic. You have security shield and I have broken shield spear. The so-called “one foot high” and “one foot high”, but internet security is also developing slowly in this kind of attack and defense. But today’s writing is not […]