# eclipse-threadx/threadx architecture

> Architecture diagram of the GitHub repository eclipse-threadx/threadx, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eclipse-threadx/threadx
- Repository: https://github.com/eclipse-threadx/threadx

## Overview

Eclipse ThreadX is an embedded real-time operating system. An application uses its kernel APIs to create threads and coordinate work through scheduling, synchronization, queues, timers, and memory services; optional module support adds a separately managed execution environment. The repository also includes an SMP kernel variant, architecture-specific ports, tracing, and a POSIX compatibility layer. The README documents these capabilities, but sampled source is limited, so most runtime relationships are shown as unverified rather than asserted calls.

Main entry points: [`common/inc/tx_api.h`](https://github.com/eclipse-threadx/threadx/blob/master/common/inc/tx_api.h) (ThreadX API), [`common/src/tx_thread_create.c`](https://github.com/eclipse-threadx/threadx/blob/master/common/src/tx_thread_create.c) (Thread scheduling), [`common_modules/module_manager/src/txm_module_manager_util.c`](https://github.com/eclipse-threadx/threadx/blob/master/common_modules/module_manager/src/txm_module_manager_util.c) (Module manager), [`common_modules/module_lib/src/txm_module_application_request.c`](https://github.com/eclipse-threadx/threadx/blob/master/common_modules/module_lib/src/txm_module_application_request.c) (Module service calls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_kernel["Kernel Services"]
  node_api["ThreadX API<br/>[tx_api.h]"]
  node_threads["Thread scheduling<br/>[tx_thread_create.c]"]
  node_sync["Synchronization<br/>[tx_semaphore_get.c]"]
  node_queues["Message queues<br/>[tx_queue_send.c]"]
  node_memory["Memory pools<br/>[tx_byte_allocate.c]"]
  node_timers["Timers &amp; time"]
  node_startup["Kernel startup"]
end

subgraph group_modules["Module Runtime"]
  node_module_api["Module API<br/>[txm_module.h]"]
  node_module_manager["Module manager"]
  node_module_lib["Module service calls"]
  node_module_dispatch["Module dispatch"]
  node_module_protection["Module protection"]
end

subgraph group_platform["Platform Support"]
  node_smp["SMP kernel"]
  node_ports["Architecture ports"]
end

subgraph group_extensions["Compatibility &amp; Observability"]
  node_trace["Trace services<br/>[tx_trace_enable.c]"]
  node_posix["POSIX adaptation"]
end

node_application(("Embedded application"))

node_application -.->|"calls"| node_api
node_api -.->|"provides services"| node_threads
node_api -.->|"provides services"| node_sync
node_api -.->|"provides services"| node_queues
node_api -.->|"provides services"| node_memory
node_api -.->|"provides services"| node_timers
node_startup -.->|"starts kernel"| node_threads
node_module_api -.->|"invokes"| node_module_lib
node_module_lib -.->|"requests service"| node_module_dispatch
node_module_manager -.->|"dispatches"| node_module_dispatch
node_module_manager -.->|"configures protection"| node_module_protection
node_posix -->|"uses queue API"| node_api
node_trace -.->|"exposes services"| node_api
node_smp -.->|"variant kernel"| node_threads
node_ports -.->|"supports execution"| node_threads

click node_api "https://github.com/eclipse-threadx/threadx/blob/master/common/inc/tx_api.h"
click node_threads "https://github.com/eclipse-threadx/threadx/blob/master/common/src/tx_thread_create.c"
click node_sync "https://github.com/eclipse-threadx/threadx/blob/master/common/src/tx_semaphore_get.c"
click node_queues "https://github.com/eclipse-threadx/threadx/blob/master/common/src/tx_queue_send.c"
click node_memory "https://github.com/eclipse-threadx/threadx/blob/master/common/src/tx_byte_allocate.c"
click node_timers "https://github.com/eclipse-threadx/threadx/blob/master/common/src/tx_timer_activate.c"
click node_startup "https://github.com/eclipse-threadx/threadx/blob/master/common/src/tx_initialize_kernel_enter.c"
click node_smp "https://github.com/eclipse-threadx/threadx/blob/master/common_smp/src/tx_thread_smp_utilities.c"
click node_ports "https://github.com/eclipse-threadx/threadx/blob/master/ports/xtensa/xcc/src/tx_xtensa_stack_error_handler.c"
click node_module_api "https://github.com/eclipse-threadx/threadx/blob/master/common_modules/inc/txm_module.h"
click node_module_manager "https://github.com/eclipse-threadx/threadx/blob/master/common_modules/module_manager/src/txm_module_manager_util.c"
click node_module_lib "https://github.com/eclipse-threadx/threadx/blob/master/common_modules/module_lib/src/txm_module_application_request.c"
click node_module_dispatch "https://github.com/eclipse-threadx/threadx/blob/master/common_modules/module_manager/src/txm_module_manager_kernel_dispatch.c"
click node_module_protection "https://github.com/eclipse-threadx/threadx/blob/master/ports_module/cortex_m3/ac5/module_manager/src/txm_module_manager_mm_register_setup.c"
click node_trace "https://github.com/eclipse-threadx/threadx/blob/master/common/src/tx_trace_enable.c"
click node_posix "https://github.com/eclipse-threadx/threadx/blob/master/utility/rtos_compatibility_layers/posix/px_system_manager.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_threads,node_sync,node_queues,node_memory,node_timers,node_startup toneBlue
class node_module_api,node_module_manager,node_module_lib,node_module_dispatch,node_module_protection toneAmber
class node_smp,node_ports toneMint
class node_trace,node_posix toneRose
class node_application toneIndigo
```

## Components

### Kernel Services

- [ThreadX API](https://github.com/eclipse-threadx/threadx/blob/master/common/inc/tx_api.h): `common/inc/tx_api.h`
- [Thread scheduling](https://github.com/eclipse-threadx/threadx/blob/master/common/src/tx_thread_create.c): `common/src/tx_thread_create.c`
- [Synchronization](https://github.com/eclipse-threadx/threadx/blob/master/common/src/tx_semaphore_get.c): `common/src/tx_semaphore_get.c`
- [Message queues](https://github.com/eclipse-threadx/threadx/blob/master/common/src/tx_queue_send.c): `common/src/tx_queue_send.c`
- [Memory pools](https://github.com/eclipse-threadx/threadx/blob/master/common/src/tx_byte_allocate.c): `common/src/tx_byte_allocate.c`
- [Timers & time](https://github.com/eclipse-threadx/threadx/blob/master/common/src/tx_timer_activate.c): `common/src/tx_timer_activate.c`
- [Kernel startup](https://github.com/eclipse-threadx/threadx/blob/master/common/src/tx_initialize_kernel_enter.c): `common/src/tx_initialize_kernel_enter.c`

### Module Runtime

- [Module API](https://github.com/eclipse-threadx/threadx/blob/master/common_modules/inc/txm_module.h): `common_modules/inc/txm_module.h`
- [Module manager](https://github.com/eclipse-threadx/threadx/blob/master/common_modules/module_manager/src/txm_module_manager_util.c): `common_modules/module_manager/src/txm_module_manager_util.c`
- [Module service calls](https://github.com/eclipse-threadx/threadx/blob/master/common_modules/module_lib/src/txm_module_application_request.c): `common_modules/module_lib/src/txm_module_application_request.c`
- [Module dispatch](https://github.com/eclipse-threadx/threadx/blob/master/common_modules/module_manager/src/txm_module_manager_kernel_dispatch.c): `common_modules/module_manager/src/txm_module_manager_kernel_dispatch.c`
- [Module protection](https://github.com/eclipse-threadx/threadx/blob/master/ports_module/cortex_m3/ac5/module_manager/src/txm_module_manager_mm_register_setup.c): `ports_module/cortex_m3/ac5/module_manager/src/txm_module_manager_mm_register_setup.c`

### Platform Support

- [SMP kernel](https://github.com/eclipse-threadx/threadx/blob/master/common_smp/src/tx_thread_smp_utilities.c): `common_smp/src/tx_thread_smp_utilities.c`
- [Architecture ports](https://github.com/eclipse-threadx/threadx/blob/master/ports/xtensa/xcc/src/tx_xtensa_stack_error_handler.c): `ports/xtensa/xcc/src/tx_xtensa_stack_error_handler.c`

### Compatibility & Observability

- [Trace services](https://github.com/eclipse-threadx/threadx/blob/master/common/src/tx_trace_enable.c): `common/src/tx_trace_enable.c`
- [POSIX adaptation](https://github.com/eclipse-threadx/threadx/blob/master/utility/rtos_compatibility_layers/posix/px_system_manager.c): `utility/rtos_compatibility_layers/posix/px_system_manager.c`

### Other components

- **Embedded application**

## Connections

- Embedded application → ThreadX API: calls
- ThreadX API → Thread scheduling: provides services
- ThreadX API → Synchronization: provides services
- ThreadX API → Message queues: provides services
- ThreadX API → Memory pools: provides services
- ThreadX API → Timers & time: provides services
- Kernel startup → Thread scheduling: starts kernel
- Module API → Module service calls: invokes
- Module service calls → Module dispatch: requests service
- Module manager → Module dispatch: dispatches
- Module manager → Module protection: configures protection
- POSIX adaptation → ThreadX API: uses queue API (evidence: `utility/rtos_compatibility_layers/posix/px_system_manager.c`)
- Trace services → ThreadX API: exposes services
- SMP kernel → Thread scheduling: variant kernel
- Architecture ports → Thread scheduling: supports execution
