WIP: fleshing out cod2 for once a bit more

Planning to try out a flavor of Ryan's multi-threaded laned procs with the some extra threads hooked up separately to a job system.
Will most likely do 2 threads main/helper on live lanes, then 2 others on job queue loops
This commit is contained in:
2025-10-11 19:17:29 -04:00
parent 7219b780fc
commit 05e979907a
20 changed files with 387 additions and 37 deletions

3
code2/host/Readme.md Normal file
View File

@@ -0,0 +1,3 @@
# Host Module
The sole job of this module is to provide a bare launch pad and runtime module hot-reload support for the client module (sectr). To achieve this the static memory of the client module is tracked by the host and provides an api for the client to reload itself when a change is detected. The client is reponsible for populating the static memory reference and doing anything else it needs via the host api that it cannot do on its own.

View File

@@ -1,8 +0,0 @@
package host
main :: proc()
{
}

24
code2/host/launch.odin Normal file
View File

@@ -0,0 +1,24 @@
package host
Path_Logs :: "../logs"
when ODIN_OS == .Windows
{
Path_Sectr_Module :: "sectr.dll"
Path_Sectr_Live_Module :: "sectr_live.dll"
Path_Sectr_Debug_Symbols :: "sectr.pdb"
}
// Only static memory host has.
host_memory: HostMemory
main :: proc()
{
host_memory.host_api.sync_client_module = sync_client_api
host_memory.client_api.startup(& host_memory)
}
@export
sync_client_api :: proc()
{
// Fill out detection and reloading of client api.
}

View File

@@ -0,0 +1,24 @@
package host
import "base:builtin"
// Odin_OS_Type :: type_of(ODIN_OS)
import "base:intrinsics"
// atomic_thread_fence :: intrinsics.atomic_thread_fence
// mem_zero :: intrinsics.mem_zero
// mem_zero_volatile :: intrinsics.mem_zero_volatile
// mem_copy :: intrinsics.mem_copy_non_overlapping
// mem_copy_overlapping :: intrinsics.mem_copy
import "base:runtime"
// Assertion_Failure_Proc :: runtime.Assertion_Failure_Proc
// Logger :: runtime.Logger
import core_os "core:os"
import grime "codebase:grime"
import "codebase:sectr"
Client_API :: sectr.ModuleAPI
HostMemory :: sectr.HostMemory