promote content scope to base layer, rename as 'access'; generalize based just on list of scope refcounts, + optional cvs; eliminate c_scope; replace dasm_scope with access as well

This commit is contained in:
Ryan Fleury
2025-09-18 15:21:22 -07:00
parent 5381307e90
commit 1b93dbd4bd
15 changed files with 203 additions and 308 deletions
+28
View File
@@ -15,6 +15,24 @@ struct LaneCtx
Barrier barrier;
};
////////////////////////////////
//~ rjf: Access Scopes
typedef struct Touch Touch;
struct Touch
{
Touch *next;
U64 *touch_count;
CondVar cv;
};
typedef struct Access Access;
struct Access
{
Access *next;
Touch *top_touch;
};
////////////////////////////////
//~ rjf: Base Per-Thread State Bundle
@@ -34,6 +52,11 @@ struct TCTX
// rjf: source location info
char *file_name;
U64 line_number;
// rjf: accesses
Arena *access_arena;
Access *free_access;
Touch *free_touch;
};
////////////////////////////////
@@ -69,4 +92,9 @@ internal void tctx_write_srcloc(char *file_name, U64 line_number);
internal void tctx_read_srcloc(char **file_name, U64 *line_number);
#define tctx_write_this_srcloc() tctx_write_srcloc(__FILE__, __LINE__)
//- rjf: access scopes
internal Access *access_open(void);
internal void access_close(Access *access);
internal void access_touch(Access *access, U64 *touch_count, CondVar cv);
#endif // BASE_THREAD_CONTEXT_H