PID:0x7F3A ADDR:0xDEADBEEF STACK:0x0040 HEAP:0x1A2B

CONCENGINE

concurrent event simulation engine

Event Loop Architecture

A single-threaded event loop coordinates all concurrent activities, dispatching messages to actors and scheduling timer callbacks with microsecond precision. The loop never blocks -- every I/O operation is non-blocking, every computation is bounded.

Concurrent Processes

event_loop
scheduler
actor_pool
msg_router
io_handler

Actor Model

Every concurrent entity is an actor with private state, a mailbox, and a behavior function. Actors communicate exclusively through asynchronous message passing -- no shared memory, no locks, no data races by construction.

api.concengine
import concengine as ce

// Create engine with 4 workers
engine := ce.NewEngine(ce.Workers(4))

// Define actor behavior
counter := ce.Actor(func(msg ce.Message) {
    state.Update("count", state.Get("count") + 1)
    msg.Reply(state)
})

// Spawn 1000 actors concurrently
actors := engine.SpawnN(counter, 1000)
engine.Run()

Message Passing

Messages are immutable, typed, and delivered in causal order. The engine guarantees that messages between any two actors arrive in the order they were sent. Broadcast, multicast, and point-to-point delivery patterns are all first-class operations.