• APC (Asynchronous Procedure Call)


    When the system creates a new thread, it will also create the queue associated with the thread, that is, the queue of asynchronous procedure call (APC). Some asynchronous operations can be realized by adding APC, such as IO request / completion I’m learning now. BOOL ReadFileEx( HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPOVERLAPPED lpOverlapped, LPOVERLAPPED_COMPLETION_ROUTINE […]

  • Talk about spring for Kafka’s encapsulation and integration of consumers


    order This article mainly analyzes the encapsulation and integration of spring for Kafka to the native Kafka client consumer. Consumer factory spring-kafka-1.2.3.RELEASE-sources.jar!/org/springframework/kafka/core/DefaultKafkaConsumerFactory.java protected KafkaConsumer<K, V> createKafkaConsumer(String clientIdSuffix) { if (!this.configs.containsKey(ConsumerConfig.CLIENT_ID_CONFIG) || clientIdSuffix == null) { return createKafkaConsumer(); } else { Map<String, Object> modifiedClientIdConfigs = new HashMap<>(this.configs); modifiedClientIdConfigs.put(ConsumerConfig.CLIENT_ID_CONFIG, modifiedClientIdConfigs.get(ConsumerConfig.CLIENT_ID_CONFIG) + clientIdSuffix); return createKafkaConsumer(modifiedClientIdConfigs); } } protected […]

  • [multithreading] thread pool source code (2)


    It’s almost three weeks since the last technical article was updated. The reason is written in the last article. No more nonsense. Let’s start the second round of reading our thread pool source code. review Briefly review the two methods involved in the previous thread pool source code. One isexecute()The entrance to the task, and […]

  • Spark – how does the RPC of each component communicate


    Basic concepts Before we start, let’s talk about a few concepts: Rpcendpoint: an instance of RPC distributed, which is used to specify the processing of messages, such as receiving messages. Rpcendpointref: the reference of rpcendpoint, that is, it points to the rpcendpoint of the server, so rpcendpointref will have the RPC address of the server. […]

  • Evolution of JavaScript asynchronous operation


    Special note This blog is minepersonalyesJavaScript asynchronous operationYesSummary and classification。 Through this article, I also hope that readers can learn frommacroscopicLook at how JavaScript asynchronous operations evolve. But if you want to master it all through this blogpromiseperhapsasyncAll the knowledge of functions and other technologies is still unrealistic. We recommend intensive readingRuan YifengTeacher’sECMAScript 6 getting […]

  • 3 – topics and queues


    Topics and queues The original message queue is a queue in a strict sense. In the computer field, “queue” is a data structure with complete and strict definition. In Wikipedia, a queue is defined as a linear list of first in first out (FIFO). In specific applications, it is usually implemented by linked list or […]

  • SPL data structure 2-heap, maximum heap, minimum heap


    Heap is a common data structure. The bottom layer is a binary tree implemented by array. But there are no parent and child pointers. Sort according to heap properties. It is divided into minimum heap and maximum heap. Minimum heap: the value of the parent node is smaller than that of each child node Maximum […]

  • Are processes, threads and coroutines confused? One article will take you through!


    preface Welcome to the operating system series, which is still explained in the form of illustration + vernacular, so that Xiaobai can understand it and help you get started quickly This chapter begins with the introduction of processes, threads and collaborative processes. I believe many white people do not understand these concepts clearly. Here are […]

  • After reading this article, I’m no longer afraid of the interviewer asking me about thread pool


    1、 Why do I need a thread pool In actual use, threads occupy system resources very much. If the thread management is not perfect, it is easy to cause system problems. Therefore, in most concurrent frameworks, thread pools are used to manage threads. The main advantages of using thread pools to manage threads are as […]

  • 025 realize double ended queue by using stack of linked list rust


    introduce Video address:www.bilibili.com/video/av78062009/Relevant source code:github.com/anonymousGiga/Rust-link… Details In this section, we use stack to implement double ended queue. Implementation stack The implementation of stack is basically similar to the implementation of single linked list at the beginning, as follows: pub struct Stack<T> { head: Link<T>, } type Link<T> = Option<Box<Node<T>>>; struct Node<T> { elem: T, next: […]

  • 1 – why do you need message queues


    Why message queuing Asynchronous processing: suppose an interface has three ABC operations, operation a can be completed quickly, but the BC operation is time-consuming. At this time, the BC operations can be put into the message queue and returned directly, so as to reduce the waiting time of the interface. flow control: suppose that our […]

  • Kafka stream word count instance


    order Kafka is not a message queue, but a log storage system in essence, and stream processing is its recently promoted feature. This paper briefly introduces the example of word count. maven <dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka-streams</artifactId> <version></version> </dependency> Prepare topic sh kafka-topics.sh –create –topic wc-input –replication-factor 1 –partitions 1 –zookeeper localhost:2181 One is WC input, and […]