Fine-grain multithreading with minimal compiler support—a cost effective approach to implementing efficient multithreading languages
Fine-grain multithreading with minimal compiler support—a cost effective approach to implementing efficient multithreading languages
复制标题
具有最少编译器支持的细粒度多线程——一种实现高效多线程语言的经济有效的方法
DOI:
--
复制
发表时间:
1997
期刊:
影响因子:
--
通讯作者:
A. Yonezawa
中科院分区:
文献类型:
--
作者:
K. Taura;A. Yonezawa
It is difficult to map the execution model of multithreading languages (languages which support fine-grain dynamic thread creation) onto the single stack execution model of C. Consequently, previous work on efficient multithreading uses elaborate frame formats and allocation strategy, with compilers customized for them. This paper presents an alternative cost-effective implementation strategy for multithreading languages which can maximally exploit current sequential C compilers. We identify a set of primitives whereby efficient dynamic thread creation and switch can be achieved and clarify implementation issues and solutions which work under the stack frame layout and calling conventions of current C compilers. The primitives are implemented as a C library and named StackThreads. In StackThreads, a thread creation is done just by a C procedure call, maximizing thread creation performance. When a procedure suspends an execution, the context of the procedure, which is roughly a stack frame of the procedure, is saved into heap and resumed later. With StackThreads, the compiler writer can straightforwardly translate sequential constructs of the source language into corresponding C statements or expressions, while using StackThreads primitives as a blackbox mechanism which switches execution between C procedures.