first pass at setting up base layer async thread path

This commit is contained in:
Ryan Fleury
2025-09-17 10:06:21 -07:00
parent 443646b356
commit 99c989a3c3
5 changed files with 162 additions and 2 deletions
+28
View File
@@ -57,6 +57,22 @@ struct FS_Stripe
////////////////////////////////
//~ rjf: Shared State Bundle
typedef struct FS_Request FS_Request;
struct FS_Request
{
FS_Request *next;
HS_Key key;
String8 path;
Rng1U64 range;
};
typedef struct FS_RequestNode FS_RequestNode;
struct FS_RequestNode
{
FS_RequestNode *next;
FS_Request v;
};
typedef struct FS_Shared FS_Shared;
struct FS_Shared
{
@@ -69,6 +85,13 @@ struct FS_Shared
FS_Slot *slots;
FS_Stripe *stripes;
// rjf: requests
Mutex req_mutex;
Arena *req_arena;
FS_RequestNode *first_req;
FS_RequestNode *last_req;
U64 req_count;
// rjf: user -> streamer ring buffer
U64 u2s_ring_size;
U8 *u2s_ring_base;
@@ -109,6 +132,11 @@ internal HS_Key fs_key_from_path_range(String8 path, Rng1U64 range, U64 endt_us)
internal U128 fs_hash_from_path_range(String8 path, Rng1U64 range, U64 endt_us);
internal FileProperties fs_properties_from_path(String8 path);
////////////////////////////////
//~ rjf: Asynchronous Tick
internal void fs_async_tick(void);
////////////////////////////////
//~ rjf: Streaming Work