1912415346
发表于 2022-9-1 19:46
666666666666666
lo49823
发表于 2022-9-1 20:23
谢谢分享
鈤釧鋼鈑
发表于 2022-9-1 22:21
gxfxxxxxxxxxxxxxxxx
ww370680604
发表于 2022-9-1 22:26
{:3_90:}{:3_90:}
空腹别吃饭
发表于 2022-9-1 22:34
666666666666666666
wenmingyy
发表于 2022-9-1 22:36
io_uring is a Linux-specific API for asynchronous I/O. It allows the user to submit one or more I/O requests, which are processed asynchronously without blocking the calling process. io_uring gets its name from ring buffers which are shared between user space and kernel space. This arrangement allows for efficient I/O, while avoiding the overhead of copying buffers between them, where possible. This interface makes io_uring different from other UNIX I/O APIs, wherein, rather than just communicate between kernel and user space with system calls, ring buffers are used as the main mode of communication. This arrangement has various performance benefits which are discussed in a separate section below. This man page uses the terms shared buffers, shared ring buffers and queues interchangeably.The general programming model you need to follow for io_uring is outlined below
[*]Set up shared buffers with io_uring_setup(2) and mmap(2), mapping into user space shared buffers for the submission queue (SQ) and the completion queue (CQ). You place I/O requests you want to make on the SQ, while the kernel places the results of those operations on the CQ.
[*]For every I/O request you need to make (like to read a file, write a file, accept a socket connection, etc), you create a submission queue entry, or SQE, describe the I/O operation you need to get done and add it to the tail of the submission queue (SQ). Each I/O operation is, in essence, the equivalent of a system call you would have made otherwise, if you were not using io_uring. You can add more than one SQE to the queue depending on the number of operations you want to request.
[*]After you add one or more SQEs, you need to call io_uring_enter(2) to tell the kernel to dequeue your I/O requests off the SQ and begin processing them.
[*]For each SQE you submit, once it is done processing the request, the kernel places a completion queue event or CQE at the tail of the completion queue or CQ. The kernel places exactly one matching CQE in the CQ for every SQE you submit on the SQ. After you retrieve a CQE, minimally, you might be interested in checking the res field of the CQE structure, which corresponds to the return value of the system call's equivalent, had you used it directly without using io_uring. For instance, a read operation under io_uring, started with the IORING_OP_READ operation, which issues the equivalent of the read(2) system call, would return as part of res what read(2) would have returned if called directly, without using io_uring.
[*]Optionally, io_uring_enter(2) can also wait for a specified number of requests to be processed by the kernel before it returns. If you specified a certain number of completions to wait for, the kernel would have placed at least those many number of CQEs on the CQ, which you can then readily read, right after the return from io_uring_enter(2).
[*]It is important to remember that I/O requests submitted to the kernel can complete in any order. It is not necessary for the kernel to process one request after another, in the order you placed them. Given that the interface is a ring, the requests are attempted in order, however that doesn't imply any sort of ordering on their completion. When more than one request is in flight, it is not possible to determine which one will complete first. When you dequeue CQEs off the CQ, you should always check which submitted request it corresponds to. The most common method for doing so is utilizing the user_data field in the request, which is passed back on the completion side.
Kazuya77
发表于 2022-9-1 22:40
感谢汉化呀,期待更新
ljj622
发表于 2022-9-1 23:10
666666666666666666666666666
liaohongpeng
发表于 2022-9-1 23:32
66666666666666
freedom21126
发表于 2022-9-1 23:43
感谢汉化期待更多的功能
894821959
发表于 2022-9-1 23:47
666666666666666666666
whosyoudady
发表于 2022-9-1 23:54
如果您要查看本帖隐藏内容请回复
qudaye2
发表于 2022-9-1 23:54
1111111111111
kdsida
发表于 2022-9-2 00:29
111111111111111111
njrnjr
发表于 2022-9-2 00:35
ddd得得得得得得
hgy0911
发表于 2022-9-2 00:54
,也是好的!
3dm_13331862
发表于 2022-9-2 00:56
666666666666666666666666
╃失去太哆メ
发表于 2022-9-2 05:55
啊撒旦士大夫士大夫
星剃斩月
发表于 2022-9-2 06:49
还有更新?
ap大蛇
发表于 2022-9-2 08:56
6666666666666
dennis1414
发表于 2022-9-2 09:15
6666666666666666
g360413
发表于 2022-9-2 10:19
66666666666666666666666666
何华谷
发表于 2022-9-2 10:56
6666666666
nmdfish
发表于 2022-9-2 12:12
666666666666666
3dm_17283480
发表于 2022-9-2 12:32
3213123213123
chengducp3
发表于 2022-9-2 12:56
6666666666666
zwqdidi
发表于 2022-9-2 13:02
感谢分享
習慣╰殇~
发表于 2022-9-2 13:05
66666666666666666666666
leonscott123
发表于 2022-9-2 13:23
ddddddddddddddddd
lx873251967
发表于 2022-9-2 16:55
66666666666666666666666666666666