Tag:descriptor

  • Android 9.0 native looper mechanism (principle)

    Time:2022-5-4

    *Standing on the shoulders of giants can see further*   Android 9.0 native looper mechanism (principle) Android 9.0 native looper mechanism (application)   preface When analyzing the native layer code of Android framework, looper, an important auxiliary class in Android system, is used in many places to communicate between threads or design processing logic. This […]

  • How to connect the network: Chapter 1

    Time:2022-4-23

    The user inputs a URL to the browser and returns the life cycle of a network request. The book is divided into six parts: The application layer client generates HTTP and delegates it to the protocol stack of the operating system The protocol stack (TCP / IP module) calls the network card driver to generate […]

  • [get the interviewer] series: three questions of the soul of the interviewer: why redis is so fast, how to support high concurrency, and how to solve the problem of concurrent competition

    Time:2022-4-23

    preface Redis is currently a hot NoSQL database, which has almost become the standard configuration of high concurrency and high availability systems. If the recognition of redis’s fast response is only based on memory and single thread, I’m afraid it’s difficult to win the offer of big companies. This article focuses on the single thread […]

  • Shell (bash) script programming III: redirection

    Time:2022-4-20

    stayThis oneIn, we introduced some basic knowledge about input-output redirection and pipeline. This article will continue the topic of redirection.Before we start, let’s talk about the in the shellquote。 quote Like many programming languages, bash also supports character escape, which is used to change the original meaning of characters and make someMetacharacter(e.g&)Can appear in the […]

  • IO multiplexing from the perspective of go programming

    Time:2022-4-8

    IO multiplexing enables the process to listen to some file descriptors through some mechanism. When there are read or write ready in the file descriptor, the process can receive the corresponding notification sent by the system kernel to carry out the corresponding IO operation; IO multiplexing includes: select, poll, epoll and other modes. Here we […]

  • Linux – IO mode and detailed explanation of select, poll and epoll

    Time:2022-4-4

    1、 Concept description Before explaining, we should first explain several concepts: User space and kernel space Process switching Blocking of processes File descriptor Cache I / O 1.1 user space and kernel space The Linux operating system and driver run in the kernel space, and the application runs in the user space. They can not […]

  • Shell redirection in Linux

    Time:2022-4-2

    In the shell script, by default, there are always three files open: standard input (keyboard input), standard output (output to the screen) and standard error (also output to the screen). Their corresponding file descriptors are 0, 1 and 2 respectively. &Is a descriptor. If 1 or 2 is not preceded by &, it will be […]

  • Linux crontab instructions

    Time:2022-3-28

    crontabIs a command used to automatically execute scripts on a regular basis Common parameters crontab -lLists all tasks that are performed automatically on a regular basis crontab -eEdit all regularly automated tasks Task format Execution cycle script path log output For example: */5 * * * * /usr/local/agenttools/agent/check_tmp_agent.sh >/dev/null 2>&1 Execution cycle * * * […]

  • Interesting question – how does VIM steal a file belonging to root

    Time:2022-3-22

    Recently, I encountered a strange problem, so I went to the English forum to find it. Here is my experience: Questioner: Witness the following:See the following command: sh-3.2$ cd testcase sh-3.2$ sudo touch temp sh-3.2$ ls -al total 0 drwxr-xr-x 3 glen staff 102 19 Dec 12:38 . drwxr-xr-x 12 glen staff 408 19 Dec […]

  • Network IO in simple terms

    Time:2022-3-4

    As the most important part of network communication, IO is often asked in the interview; This paper will start from the basis of computer composition and introduce its principle and application around several common IO models; Then it will explore the implementation of multiplexing under Linux and other platforms; Understand these basic knowledge and the […]

  • Linux kernel (VII) polling operation

    Time:2022-2-27

    Concept and function of polling In the user program, select () and poll () are also related to device blocking and non blocking access.Applications that use non blocking IO typically use Select () and poll () system calls to query whether non blocking access to devices is possible.The select () and poll () system calls […]

  • Principle of receiving data from kernel to epoll

    Time:2022-2-16

    1、 Kernel receiving data flow The kernel receives data png 1.When the network card finds that the MAC address matches, it receives the packet; It is found that the IP address is consistent. According to the protocol item in the IP header, it is known that the upper layer is TCP protocol; 2.DMA copies TCP […]