mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 06:58:30 +00:00
Sync SDL3 wiki -> header
[ci skip]
This commit is contained in:
@@ -67,14 +67,14 @@
|
|||||||
*
|
*
|
||||||
* ## Best Practices
|
* ## Best Practices
|
||||||
*
|
*
|
||||||
* Simple non-blocking i/o--for an app that just wants to pick up data
|
* Simple non-blocking I/O--for an app that just wants to pick up data
|
||||||
* whenever it's ready without losing framerate waiting on disks to spin--can
|
* whenever it's ready without losing framerate waiting on disks to spin--can
|
||||||
* use whatever pattern works well for the program. In this case, simply call
|
* use whatever pattern works well for the program. In this case, simply call
|
||||||
* SDL_ReadAsyncIO, or maybe SDL_LoadFileAsync, as needed. Once a frame, call
|
* SDL_ReadAsyncIO, or maybe SDL_LoadFileAsync, as needed. Once a frame, call
|
||||||
* SDL_GetAsyncIOResult to check for any completed tasks and deal with the
|
* SDL_GetAsyncIOResult to check for any completed tasks and deal with the
|
||||||
* data as it arrives.
|
* data as it arrives.
|
||||||
*
|
*
|
||||||
* If two separate pieces of the same program need their own i/o, it is legal
|
* If two separate pieces of the same program need their own I/O, it is legal
|
||||||
* for each to create their own queue. This will prevent either piece from
|
* for each to create their own queue. This will prevent either piece from
|
||||||
* accidentally consuming the other's completed tasks. Each queue does require
|
* accidentally consuming the other's completed tasks. Each queue does require
|
||||||
* some amount of resources, but it is not an overwhelming cost. Do not make a
|
* some amount of resources, but it is not an overwhelming cost. Do not make a
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
* were submitted, so it doesn't generally matter what order tasks are
|
* were submitted, so it doesn't generally matter what order tasks are
|
||||||
* started.
|
* started.
|
||||||
*
|
*
|
||||||
* One async i/o queue can be shared by multiple threads, or one thread can
|
* One async I/O queue can be shared by multiple threads, or one thread can
|
||||||
* have more than one queue, but the most efficient way--if ruthless
|
* have more than one queue, but the most efficient way--if ruthless
|
||||||
* efficiency is the goal--is to have one queue per thread, with multiple
|
* efficiency is the goal--is to have one queue per thread, with multiple
|
||||||
* threads working in parallel, and attempt to keep each queue loaded with
|
* threads working in parallel, and attempt to keep each queue loaded with
|
||||||
|
Reference in New Issue
Block a user