软件架构的控制流总结

来源:互联网 发布:软件模块测试报告 编辑:程序博客网 时间:2024/05/18 02:56

在进行程序开发时,要从总体上对软件架构进行规划,软件架构(software architecture)包括两个aspects,control flow and data flow。这里先对typical software architecture control flow进行summarize,后续的文章将继续对data flow进行梳理和总结。这里要感谢dossier-andreas,把software architecture讲述的有清晰、有条理。让我这英语菜鸟也有机会读得懂。

1. Main program and subroutine,call and return(main函数和调用)

Command structure: Control Tree; Order of execution:Sequential.

这是一个最基础和最常见的控制流,在C、C++等几乎所有语言都支持。

2. Implicit invocation, Event Based(隐式调用)


依靠Message传递控制,主程序由无尽的控制循环构成,每次循环主程序都将Message发送给对应的模块去处理。类似windows MFC的消息机制,winmain函数中是一个大循环,用来接收消息,然后调用对应的module来处理消息。

3. The Manager Model 系统管理器模型


Commandstructure: Control Tree; Order of execution: Parallel.

这就是多进程的模型。由PCB(process control block,进程控制块)来负责存储和维护进程信息。主要由操作系统来实现Manager Model。实际上,在FPGA硬件上的并行就是一个个的process。

4. Emulated Parallel(模拟并行)


Command structure: Control Loop; Order ofexecution: Parallel.

这实际上是进程的实现模型(或者是进程内线程的实现模型)。时间片轮转调度,每一个循环分配给一个Module一段执行时间,就这样类似的将所有Module都推进,相当于并行执行。

 

参考文献:http://www.dossier-andreas.net/software_architecture







0 0
原创粉丝点击