并发原语Skill ConcurrencyPrimitives

并发原语技能是用于设计和实现编程语言底层并发支持的核心技术,涵盖线程、通道、同步机制、调度器、内存模型等关键组件。该技能适用于运行时系统开发、编译器实现、高性能计算框架构建等领域。关键词:并发编程,线程模型,消息传递,同步原语,调度器设计,内存模型,绿色线程,协程系统。

架构设计 0 次安装 0 次浏览 更新于 2/25/2026

名称: 并发原语 描述: 实现语言级并发支持的专家技能,包括线程、通道和同步 类别: 运行时 允许的工具:

  • 读取
  • 写入
  • 编辑
  • 全局匹配
  • 文本搜索
  • Bash

并发原语技能

概述

实现语言级并发支持的专家技能,包括线程、通道和同步。

能力

  • 设计线程API和原语
  • 实现互斥锁和条件变量
  • 实现基于通道的消息传递
  • 设计异步/等待和协程系统
  • 实现工作窃取调度器
  • 处理线程本地存储
  • 设计内存模型和排序
  • 实现绿色线程/goroutine

目标流程

  • concurrency-primitives.js
  • interpreter-implementation.js
  • bytecode-vm-implementation.js
  • garbage-collector-implementation.js

依赖

并发理论,Go调度器参考资料

使用指南

  1. 模型选择: 根据语言目标在共享内存和消息传递之间选择
  2. 内存模型: 明确定义内存排序语义
  3. 调度: 设计调度器时考虑公平性和效率
  4. 集成: 确保垃圾回收和并发正确协同工作
  5. 测试: 从一开始就构建并发压力测试

输出模式

{
  "type": "object",
  "properties": {
    "model": {
      "type": "string",
      "enum": ["shared-memory", "message-passing", "actor", "csp"]
    },
    "primitives": {
      "type": "array",
      "items": { "type": "string" }
    },
    "schedulerType": {
      "type": "string",
      "enum": ["os-threads", "green-threads", "work-stealing", "cooperative"]
    },
    "generatedFiles": {
      "type": "array",
      "items": { "type": "string" }
    }
  }
}