• On the analysis of think queue


    preface Before analysis, please understand the implementation of message queue If you don’t know, please read the following: Design of liking message queue Design of qunar network message queue TP5 message queue is based on database redis and top think, which is officially implemented by TPThis chapter focuses on the analysis of redis Storage key: […]

  • How to use pulsar as a message queue


    The author is Luk Perkins from the Splunk team.The translation of the article has been authorized by the original author. Message queuing is a major component of most large-scale data architectures. IfmustFor real-time data processing, message queuing is a good choice. The data processing pipeline will have various failures, the data consumer may be delayed […]

  • In depth analysis of reentrantlock source code and AQS source code, from entry to grave, it is recommended to collect first!


    1、 Introduction to reentrantlock and AQS Prior to Java 5.0, the only mechanisms available for coordinating access to shared objects were synchronized and volatile. Java 5.0 adds a new mechanism: reentrantlock. Reentrantlock is not an alternative to built-in locking, but as an optional advanced feature. Reentrantlock implements the lock interface and provides an unconditional, polling, […]

  • Principle and application from reentrantlock to AQS


    preface Java (JUC: java.util.concurrent )Among them, reentrantlock and semaphore, which are familiar to us, all use a common base class abstractqueuedsynchronizer, abbreviated as AQS. AQS is a framework for building locks and synchronizers. Using AQS can easily and efficiently construct a large number of synchronizers that are widely used, such as reentrantlock, semaphore, and others […]

  • Mpmcqueue source code analysis (2)


    About queue template <typename T, typename Allocator = AlignedAllocator<Slot<T>>> class Queue { private: static_assert(std::is_nothrow_copy_assignable<T>::value || std::is_nothrow_move_assignable<T>::value, “T must be nothrow copy or move assignable”); static_assert(std::is_nothrow_destructible<T>::value, “T must be nothrow destructible”); The first template parameter is the object type of the queue storage. The second template parameter is the memory allocator. By default, alignedallocator is used, […]

  • Interviewer: do you know the time wheel algorithm? How is it applied in netty and Kafka? Why not use timers and delayed thread pools?


    In every era, people who can learn will not be treated badly Hello, I’m yes. Recently, I saw the time wheel algorithm in Kafka. I remember I saw this thing in netty before. I didn’t pay much attention to it. Today, let’s see what the time wheel is. Why do we use time round to […]

  • Websocket H5 controls PC large screen collaboration


    Interactive experience After receiving the product demand list, ah, it’s tiring to say that most of them are tired. In recent days, I’ve been writing about this demand Brief description of requirements: customers need to scan the code to H5 mobile terminal to control the large screen of PC terminal. Of course, the mobile terminal […]

  • On JavaScript data structure (double ended queue)


    A double ended queue is an ordered collection of items similar to a queue. In fact, it is a queue in essence. It is only a queue with both front-end and back-end supporting insert and delete operations, which is more practical. Therefore, there is no such statement as FIFO. We can do this through arrays, […]

  • JavaScript operation mechanism


    1. Single thread JavaScript JavaScript is a single thread language, which is determined by its purpose. As the script language of browser, it is mainly responsible for interacting with users and operating dom. If JavaScript is multithreaded, two threads operate a DOM node at the same time, one is responsible for deleting the DOM node, […]

  • Queue chain storage


    Linked list realizes queue Create three files: queuelinked. H, queuelinked. C, queuelinkedtest. C queueLinked.h #ifndef QUEUE_LINKED_H_ #define QUEUE_LINKED_H_ #ifdef __GNUC__ #define DEPRECATED __attribute__( (deprecated) ) #elif defined(_MSC_VER) #define DEPRECATED __declspec( deprecated ) #else #define DEPRECATED #endif #ifndef PTOI #define PTOI( p ) ((int32_t)(int64_t)(p)) #endif #ifndef ITOP #define ITOP( i ) ((void *)(int64_t)(i)) #endif #define ADT […]

  • Face to face Manual Chapter 9 what is a queue? What is double end queue, delay to column, blocking queue, all knowledge blind area! “


    Author: little brother FuBlog: https://bugstack.cn Precipitation, sharing, growth, let yourself and others can have a harvest! 1、 Preface The most important thing to buy a house is the house pattern! If you can accept the geographical location and square meter price, the most important thing is the housing pattern.what? mother-in-law! You A kind of Get […]

  • Structure and algorithm (02): queue and stack structure


    Source code:GitHub. Click here || Gitee. Click here 1、 Queue structure 1. Basic concepts Queue is a kind of special linear table. Its particularity is that it only allows deletion at the front of the table, but inserts at the back end of the table. Like stack, queue is a kind of linear table with […]