• Source code analysis of spool — swbuffer of memory module


    preface swooleReceiving and sending of data (e.greactorThe thread accepts the client message, sends the message to the client, receives the message from the clientworkerMessage to send toworkerThe buffer is involved,swooleThe buffer implementation in isswBufferIt’s actually a single linked list. swBufferData structure of swBufferIn data structuretrunk_numIs the number of linked list elements,trunk_sizeyesswBufferWhen the buffer is created, […]

  • Magix.Cache introduce


    Please indicate the source of Reprint:https://github.com/thx/magix/… In the front-end development process, we often cache some data in memory. In fact, JavaScript caching is relatively simple. We only need to declare a variable or hang some data to an object. For example, we need to implement a method to cache all Ajax requests. The simple implementation […]

  • Read the source code with Dabin – redis 7 – simple dynamic string of object coding


    Redis does not directly use the traditional string representation of C language (an array of characters ending with an empty string), but constructs a string representation calledSimple dynamic stringSDS is used as the default string representation of redis. In redis, the C string is only used as literal quantity of the string in places where […]

  • K8s (6) | configure NFS dynamic volume to provide persistent storage


    preface In this section, k8s uses NFS remote storage to provide a dynamic storage service for the managed pod. The creator of the pod does not need to care about the way in which the data exists, but only needs to make an application for how much space it needs. The overall process is as […]

  • Boost circular queue_ buffer


    The ring queue of boost library is flexible. It supports forward or backward insertion, deletion of the first or last element of the queue. Paste code only: #include #include #include #include using namespace std; class C_usrdata{ public: int x; int y; }; void DispCirBuff(boost::circular_buffer &oCircularBuffer){ for(boost::circular_buffer::iterator it=oCircularBuffer.begin(); it!=oCircularBuffer.end(); it++){ cout << (*it).x << ” ” […]

  • Channel: Notes on go expert programming


    Channel concept The way of communication between CO programs provided by go in language layer initialization Var Chan int // pipe declaration //The value is nil Ch1: = make (Chan int) // unbuffered pipe CH2: = make (Chan int, 2) // pipeline with buffer operation Operator The operator “< -” represents the data flow direction. […]

  • Why can redis single thread achieve high performance and IO multiplexing


    1: IO multiplexed epoll IO multiplexing is simply a thread processing multiple network requests. We know that the event trigger of epoll in is readable, which is easy to understand. For example, when a connection or data is sent, the in event is triggered. How is the out event triggered? Epoll has two modes: LT […]

  • Redis AOF persistence


    Redis is a kind of in memory database, which saves data in memory, and its reading and writing efficiency is much faster than the traditional database which saves data on disk. But once the process exits, redis’s data will be lost. To solve this problem, redis provides two persistence schemes, RDB and AOF, which save […]

  • Nginx learning architecture


    Source: http://blog.seclibs.com/nginx… The program architecture of nginx is as follows Later, we will comb the architecture of nginx according to the content shown in this figure. The content involved in this paper is mainly for Linux system. The top master process is directly controlled by the administrator, and only the master receives the administrator’s signal. […]

  • C language character array application example 1: write a program, connect two strings, do not use the strcat function.


    The connection of strings is shown in the figure   If there are n elements in string 1, the I th element in string 2 is assigned to the I + N element in string 1. N can be found by looping through the string 1 until ‘\ 0’. The code is as follows. #include […]

  • Caching and buffering


    The idea of cache has a long history. In short, the purpose of cache is to save the calculation results which need to be expensive and take them out directly when they are needed in the future, so as to avoid repeated calculation. Computers and even the Internet, the application of cache is numerous, we […]

  • Precharge operation in nonvolatile fram


    Ferroelectric memory (FRAM) is a kind of random access memory, which is a kind of non-volatile memory with special technology. It combines the fast read and write access of DRAM, which is the most commonly used type of personal computer storage, with the ability to retain data after power off (just like other stable storage […]