在基于模块组合的图形化编程中,存在大量互不依赖的模块,这些模块具有并行执行的性质。翻译程序以拓扑排序算法遍历该有向无环图,为每个模块产生一个线程,为每条输入线产生一个信号量,以同步有依赖关系的模块的执行顺序,最终产生一个可并行执行的多线程程序,从而达到自动挖掘并行性、提高所生成程序的运行效率的目的。
In graphic programming based on module composition, there are many modules which are independent of each other and can be executed in parallel. The translating program traverses the DAG, generates a thread for every module, and generates a semaphore for every arc in order to synchronize the executing sequence of the modules which are dependent on each other, then generates a multithread program, which runs in parallel more efficiently at last.