A New Transformation based on Process-Message Duality for Concurrent Logic Languages
Kouichi Kumon and Keiji Hirata
Abstract:
In a concurrent logic language,
mapping from the objects in a programmer's mind
to actual processes and messages often results
in less-than-optimum performance.
One reason for this is that an incorrect prediction of the dynamic
behavior and the resulting irrelevant mapping make
the execution threads short and
thus result in frequent suspensions.
Also, good performance may be less important than
the ease of writing and reading programs.
Although in typical language processing systems for a concurrent
logic language,
shorter execution threads are likely to cause inefficiency,
only few attempts extend the thread length
by improving the scheduling policy of processing systems.
We are proposing a new technique for extending thread length,
by exchanging the roles of the processes and messages of a source
program; we call this technique a {\it duality transformation}.
This technique improves program performance without the need for
modifying the language processing systems.
Processes and messages in a concurrent logic language can perform
the same roles, making it is possible to transform
processes to messages, and vice versa. Furthermore, the notion of
process-message duality not only improves efficiency, but also
gives rise to new programming methodologies, which allow meta-level
programming without meta-language facilities.
In this paper, we discuss the concept of duality of processes
and messages, details of the transformation to a dual
program, and some actual applications of this transformation.