Coder Social home page Coder Social logo

xxddq's Introduction

xxddq

小小调度器16位版本 小小调度器 V1.1 设计原理 (讨论稿) By smset 前言: 小小调度器是一款基于 C 语言的,协作式多任务编程框架。它基于状态机原理实现,所有任务 均采用公共堆栈,具有简单小巧,易于移植的特点,非常适合于资源紧张的单片机编程使用。 小小调度器的多任务并行机制和传统的状态机的并行机制原理是想通的。

主要的区别在于:小小调度器利用了 C 语言的__LINE__宏,这个__LINE__宏,代表了源文件中 代码的行号,通过将代码行号保存到静态变量的方式,来记录程序运行的位置信息,从而使得 原来需要人工实现的状态值设计、状态变量赋值以及状态跳转的系列编程工作,大部分均由记 录行号的宏自动实现了,使得开发者可以节省很多底层的状态设计和处理的编程工作。 基于此核心原理,小小调度器设计了一个框架和宏定义,以极低的 CPU 资源代价,模拟了一个 和真实 RTOS 系统相似的多任务编程环境,使得编程者可以用更自然、更优雅、更易于理解的方 式,来编写多任务并行代码,把时间和精力,更多的放在应用业务层逻辑的代码实现上。

xxddq's People

Contributors

smset028 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.