PREV UP NEXT StackThreads/MP: version 0.77 User's Guide

Chapter 6: Cooperating with Sequential Modules

This chapter describes issues that may arise when StackThreads/MP modules cooperate with sequential modules. In this chapter, a procedure is said to be a StackThreads/MP procedure when it is compiled via stgcc (or stg++). A procedure is otherwise said to be a sequential procedure. Whether a procedure actually does something in parallel is irrelevant. There is a set of rules for calling sequential procedure from within a StackThreads/MP procedure and another set of rules for calling in the other direction.

Remember that stgcc can almost always substitute gcc, therefore you can make any C procedure a StackThreads/MP procedure by recompiling it by stgcc. So you can normally avoid complication by recompiling everything with stgcc. You may still want to have non-StackThreads/MP module either because the source of the sequential module is not available or because recompiling for StackThreads/MP is undesirable.

  • Calling Sequential Procedure from StackThreads/MP Procedure
  • Calling StackThreads/MP Procedure from Sequential Procedure