Submit async-io to the OS. Next step is replacing all FIO calls with async-io and removing the old code.
30 lines
1.1 KiB
Markdown
30 lines
1.1 KiB
Markdown
# AIO & Assets
|
|
|
|
## Async IO:
|
|
- Batches of loads (vy_load_batch)
|
|
- Each load: file-id, offset-in-file, num-bytes, destination buffer
|
|
- SubmitLoadBatch() -> Handle for whole batch or handles for each file op?
|
|
- Reason: Better saturation of disk interface
|
|
- Batch interacts nicely with asset system described below:
|
|
|
|
## Assets
|
|
- Have a tool that detects asset dependencies (maybe the same tool that bakes assets into their runtime format)
|
|
- i.e. world-cell -> meshes -> textures
|
|
- Bake into a single binary (asset_meta.bin)
|
|
- Have that file loaded at runtime at all times
|
|
- DetermineAssetDependencies() -> CreateLoadBatch(asset-id)
|
|
- CreateLoadBatch() could take a cache into account
|
|
|
|
### File Storage in Memory
|
|
- Linked lists of block-regions with fixed size blocks (bitmap allocator)
|
|
- E.g. 1, 2, 3, 5 mb (maybe down to kb) blocks
|
|
- Blocks have refcounts, explicitly increased/decreased
|
|
- Either lock the whole region or lock individual blocks
|
|
|
|
### Cache
|
|
- Hold one reference to storage
|
|
- Track how much space is taken for cache
|
|
- Evict LRU(?) once taken space exceeds threshold
|
|
- Copies could be managers handed to the cache
|
|
|