=================================================================== RCS file: /home/cvs/OpenXM/doc/OpenXM-specs/communication-model.tex,v retrieving revision 1.3 retrieving revision 1.12 diff -u -p -r1.3 -r1.12 --- OpenXM/doc/OpenXM-specs/communication-model.tex 2000/01/21 01:30:38 1.3 +++ OpenXM/doc/OpenXM-specs/communication-model.tex 2020/03/14 01:21:56 1.12 @@ -1,28 +1,29 @@ -%% $OpenXM: OpenXM/doc/OpenXM-specs/communication-model.tex,v 1.2 2000/01/20 09:22:01 noro Exp $ -//&jp \section{ Open XM の通信モデル} -//&eg \section{ Communication model of Open XM} (This part has not yet been translated) +%% $OpenXM: OpenXM/doc/OpenXM-specs/communication-model.tex,v 1.11 2016/08/28 02:43:13 takayama Exp $ +//&jp \section{ OpenXM ������篆<�≪�����} +//&eg \section{ Communication model of OpenXM} /*&jp -われわれは, 数学プロセスがメッセージを -交換しながら計算が進行していくというモデルを想定して設計をすすめている. -各プロセスはスタックマシンであり, これを OX スタックマシンとよぶ. -数学プロセスの間の通信路の確保の仕方としては以下のように -いろいろな実現方法を想定している. +���������������, ��医����������祉�鴻����<����祉�若�吾�� +篋ゆ��������������荐�膊������画�������������������������≪����������喝��������荐�荐����������������������. +�����������祉�鴻����鴻�帥����������激�潟�с�����, ��������� OX ��鴻�帥����������激�潟��������. +��医����������祉�鴻�����������篆∴君���腆坂�����篁���鴻�����������篁ヤ�������������� +���������������絎��憝�号�������喝��������������. \begin{enumerate} -\item ファイルを介して通信する. -\item Library として直接リンクして通信する. -\item TCP/IP ソケットの利用. -\item Remote Procedure call の利用. -\item マルチスレッドの利用. -\item PVM ライブラリの利用. -\item MPI ライブラリの利用. +\item �����<�ゃ�����篁����������篆<�����. +\item Library �����������贋・�����潟�����������篆<�����. +\item TCP/IP ��純�宴��������������. +\item Remote Procedure call ���������. +\item JAVA RMI. +\item �����������鴻�����������������. +\item PVM �����ゃ�����������������. +\item MPI �����ゃ�����������������. \end{enumerate} -通信とはプロセス間のメッセージのやりとりである. -メッセージは論理的に次のような構造をもつ: +���篆<�������������祉�拷�������<����祉�若�吾����������������с�����. +��<����祉�若�吾��茫����������罨<�����������罕�������������: */ /*&eg -In our model of comutation, mathematical processes proceed +In our model of computation, mathematical processes proceed a computation by exchanging messages. Each process is a stack machine, which is called an OX stack machine. The following methods are possible to realize communications between @@ -32,12 +33,13 @@ mathematical processes. \item Linking as a subroutine library. \item TCP/IP streams. \item Remote Procedure call. -\item Muitithread. +\item JAVA RMI. +\item Multi-thread. \item PVM library. \item MPI library. \end{enumerate} -In OpenXM Communication is exechange of messages between processes. +In OpenXM communication means exchange of messages between processes. A message has the following structure: */ /*&C @@ -51,62 +53,62 @@ A message has the following structure: \end{center} */ /*&jp -このメッセージを, OX Message (Open XM message object) とよぶ. -OX Message はトップレベルのメッセージ object であり, -仕様書では, さまざまなグループに属する object が登場する. -グループ名は, たとえば, OX Message/TCPIP/Basic0 などと書く. -{\tt message\_body} の部分の仕様は, OX Message -の上位に位置する部分であり, SMobject または CMObject がくる. -これらの object はタグをもち, そのタグ定数は {\tt SM\_} または -{\tt CMO\_} ではじまる. -SMobject は, スタックマシンコマンドメッセージ object であり, -やはり, グループ分けされている. -各グループ名は, -SMobject/Basic0, SMobject/Basic1 などと書く. -SMobject の構造は -サーバスタックマシンの節で詳しく説明する. -CMObject についてはすでに Basic0 の CMObject の説明をしたが, -あとで CMObject レベル 1の説明をする. -OX Message の -{\tt ox message\_tag} の定数は {\tt OX\_} で始まる. +��������<����祉�若�吾��, OX message (OpenXM message object) ���������. +OX Message ��������������������������<����祉�若�� object ��с�����, +篁�罕���吾�с��, �����障����障����違����若�����絮������� object �����糸�眼�����. +��違����若��������, ������������, OX Message/TCPIP/Primitive �����������吾��. +{\tt message\_body} ������������篁�罕����, OX Message +���筝�篏����篏�臀���������������с�����, SMobject ��障����� CMObject ���������. +������������ object �����帥�違��������, ��������帥�医����違�� {\tt SM\_} ��障����� +{\tt CMO\_} ��с�������障��. +SMobject ���, ��鴻�帥����������激�潟�潟����潟����<����祉�若�� object ��с�����, +���������, ��違����若�����������������������. +�����違����若��������, +SMobject/Primitive, SMobject/Basic �����������吾��. +SMobject ���罕������� +��泣�若����鴻�帥����������激�潟��膀���ц�潟����顄����������. +CMObject �����ゃ�������������с�� Primitive ��� CMObject ���茯����������������, +��������� CMObject ��������� 1���茯�������������. +OX Message ��� +{\tt ox message\_tag} ���絎���違�� {\tt OX\_} ��у����障��. */ /*&eg We call it an OX message (OpenXM message object). -OX Message is the top level message object. +OX message is the top level message object. The OX messages are classified into three types: DATA, COMMAND, and SPECIAL. They are distinguished by {\tt ox message\_tag}. The name of an ox message tag begins with {\tt OX\_}. Typical OX message tags are {\tt OX\_COMMAND} followed by -SMobject and {\tt OX\_DATA} followed by CMOobject. +SMobject and {\tt OX\_DATA} followed by CMObject. Each message object also has its tag. For SMobject, the name -of a tag begins with {\tt SM\_}. For CMOobject, the name of +of a tag begins with {\tt SM\_}. For CMObject, the name of a tag begins with {\tt CMO\_}. An SMobject represents a stack machine command and categorized -into several groups such as SMobject/Basic0, SMobject/Basic1. +into several groups such as SMobject/Primitive, SMobject/Basic. The details of SMobjects will be explained in Section \ref{sec:stackmachine}. -We have already explained the Basic0 CMOobjects. -We will describe the Basic1 CMOobjects later. +We have already explained the Primitive CMObjects. +We will describe the Basic CMObjects in Section \ref{sec:basic1}. */ -//&jp \subsection{ OX Message の 表現方法 } +//&jp \subsection{ OX Message ��� 茵��憝�号�� } //&eg \subsection{ OX Messages } /*&jp -Open XM で各プロセスは +OpenXM ��у����������祉�鴻�� \begin{center} -(OXexpression を理解するスタックマシン) $+$ (xxx 言語で動くエンジン) +(OXexpression ������茹c�������鴻�帥����������激��) $+$ (xxx 荐�茯���у����������潟�吾��) \end{center} -なるハイブリッド構成である. -このプロセスを, OX スタックマシンと呼ぶ. -ここでは, OX スタックマシンとやりとりするメッセージである, -OX Message を表現するための OXexpression, および, -スタックマシンの operator に対応する, SMobject を表現するための SMexpression -を定義しよう. -OX Message を スタックマシンコマンド, -SMobject を スタックマシンオペレータともよぶ. +�����������ゃ�����������罕������с�����. +��������������祉�鴻��, OX ��鴻�帥����������激�潟����若��. +��������с��, OX ��鴻�帥����������激�潟����������������������<����祉�若�吾�с�����, +OX Message ���茵��憗�������������� OXexpression, ���������, +��鴻�帥����������激�潟�� operator ���絲上��������, SMobject ���茵��憗�������������� SMexpression +���絎�臂����������. +OX Message ��� ��鴻�帥����������激�潟�潟����潟��, +SMobject ��� ��鴻�帥����������激�潟����������若�帥�����������. */ /*&eg -In Open XM, each process may have a hybrid interface; +In OpenXM, each process may have a hybrid interface; it may accept and execute not only stack machine commands, but also its original command sequences. We call such a process an OX stack machine. @@ -114,6 +116,8 @@ to express OX messages and SM objects respectively. to express OX messages and SM objects respectively. */ +//&jp \subsubsection{ OX ��<����祉�若�吾��茵��憝�� (Lisp 蘂�) } +//&eg \subsubsection{ Expressions of OX messages (Lisp like) } /*&C \begin{eqnarray*} \mbox{OXexpression} @@ -129,19 +133,19 @@ to express OX messages and SM objects respectively. \end{eqnarray*} */ /*&jp -expression の各要素を区切るために {\tt ,} (コンマ) を用いてもよい. -{\tt OX\_tag} は {\tt OX\_} で始まる定数である. -{\tt SM\_tag} は {\tt SM\_} で始まるスタックマシンオペレータを識別する定数である. -発信元 AAA, 受信先 BBB を書く必要があるときは, -From AAA, To BBB, を OXexpression の前に書く. -必要なければ省略する. +expression ������荀�膣������阪�������������� {\tt ,} (��潟�潟��) ���������������������. +{\tt OX\_tag} ��� {\tt OX\_} ��у����障��絎���違�с�����. +{\tt SM\_tag} ��� {\tt SM\_} ��у����障����鴻�帥����������激�潟����������若�帥��茘���ャ�����絎���違�с�����. +��坂拭��� AAA, ���篆≦�� BBB �����吾�鏆�荀�������������������, +From AAA, To BBB, ��� OXexpression �����������吾��. +綽�荀������������亥����ャ�����. -たとえば, あとで説明する, CMO string ``Hello'' を スタックにプッシュする -表現は次のように書く: +������������, ��������ц�����������, CMO string ``Hello'' ��� ��鴻�帥����������������激�ャ����� +茵��憗��罨<�������������吾��: */ /*&eg -A comman `{\tt ,}' may be used to separate elements in an expression. +A comma `{\tt ,}' may be used to separate elements in an expression. {\tt OX\_tag} is a constant which denotes an OX message tag. {\tt SM\_tag} is a constant which denotes an SM command tag. If a sender AAA or a receiver BBB has to be specified, @@ -157,14 +161,14 @@ push a CMO string ``Hello''. */ -/*&jp +/*&eg The following expression means a request to execute a local function ``hoge''. */ /*&C \begin{center} -(OX\_DATA, (CMO\_STRING, 5, "hoge")) +(OX\_DATA, (CMO\_STRING, 4, "hoge")) \end{center} \begin{center} (OX\_COMMAND, SM\_executeStringByLocalParser) @@ -172,36 +176,72 @@ a local function ``hoge''. */ /*&jp +罔�羣������潟�潟�若��羈���с��, �����������������帥�違�� 32 bit (4 bytes) ��� +��������������若�������ゃ�������若����с����贋�違��������茵��憗��������. +*/ +/*&eg In our standard encoding method, each tag is expressed as -a 32 bit (4 byte) integer with the network byte order. +a 32 bit (4 bytes) integer with the network byte order. */ -//&jp \subsection{OXexpression の 標準 encoding と TCP/IP ソケットによる実装法} -//&eg \subsection{Standard enconding of OXexpressions and an implementation by TCP/IP sockets} +/*&C + +*/ + +//&jp \subsubsection{ OX ��<����祉�若�吾��茵���� (XML) } +//&eg \subsubsection{ Expression of OX messages (XML) } + /*&jp -通信の実現方法は通信路のとりかたによりかわるが, -論理構造は統一的にあつかわないといけない. -OXexpression はその論理構造を記述している. +OX ��<����祉�若�吾�� XML ��ц;�憗�������������������純�с�����. 罨<��箴����腓冴��. +*/ +/*&eg +OX messages can be expressed by XML. The following is an example. +*/ +/*&C +\begin{verbatim} + + + 0 + + 5 + "Hello" + + + + + 1 + + + +\end{verbatim} +*/ -ここでは OXexpression の標準 encoding の概略を説明する. -この encoding 法はTCP/IP ソケット用の encoding 法として -現在存在しているサーバに使用されている. -さらにOX スタックマシンの計算状態を制御するための, コントロールメッセージに -ついても説明する. +//&jp \subsection{OXexpression ��� 罔�羣� encoding ��� TCP/IP ��純�宴��������������絎�茖�羈�} +//&eg \subsection{Standard encoding of OXexpressions and an implementation by TCP/IP sockets} +/*&jp +���篆<��絎��憝�号��������篆∴君������������������������������������, +茫����罕�������腟延�������������ゃ��������������������������. +OXexpression ���������茫����罕�������荐�菴違�����������. +��������с�� OXexpression ���罔�羣� encoding ���网���ャ��茯����������. +������ encoding 羈����TCP/IP ��純�宴����������� encoding 羈���������� +�憜��絖������������������泣�若�����篏睡�����������������. +���������OX ��鴻�帥����������激�潟��荐�膊���倶�������九勝���������������, ��潟�潟�������若����<����祉�若�吾�� +��ゃ��������茯����������. -{\tt destination}, {\tt origin} の部分は, ソケットによる -peer to peer の接続なので省略する. -{\tt extension} フィールドは -{\tt message\_tag} フィールドの次にくる. -{\tt extension} フィールドは OX パケットのシリアル番号がはいる. -シリアル番号は {\tt int32} である. -この番号は, サーバがエラーを起こした場合, エラーをおこした, -OX パケットの番号を戻すのに主に利用される. -以下 {\tt extension} フィールドは, {\tt message\_tag} の -に含まれると理解し {\tt extension} フィールドは省略する. -したがってパケットは -次のように記述する + +{\tt destination}, {\tt origin} ������������, ��純�宴�������������� +peer to peer ����・膓���������х����ャ�����. +{\tt extension} �����c�若�������� +{\tt message\_tag} �����c�若��������罨<��������. +{\tt extension} �����c�若�������� OX �����宴����������激����≪������垩�����������. +��激����≪������垩�� {\tt int32} ��с�����. +����������垩��, ��泣�若�������������若��莎激����������翫��, ��������若��������������, +OX �����宴������������垩����祉��������筝祉�����������������. +篁ヤ�� {\tt extension} �����c�若��������, {\tt message\_tag} ��� +��������障�����������茹c�� {\tt extension} �����c�若�������������ャ�����. +�����������c�������宴�������� +罨<�����������荐�菴違����� */ /*&eg @@ -231,24 +271,25 @@ Thus OX messages are represented as follows. \end{tabular} \end{center} */ -//&jp が, もっとこまかく見ると, -//&eg More precisely it has the following representation. +//&jp \noindent ���, �����c�������障����頳�������, +//&eg \noindent More precisely it has the following representation. /*&C \begin{center} \begin{tabular}{|c|c|} \hline -{\tt ox message\_tag}, \ {\tt packet number}&{\tt message\_body} \\ +{\tt ox message\_tag}, \ {\tt serial number}&{\tt message\_body} \\ \hline \end{tabular} \end{center} */ /*&jp -となっている. +\noindent +��������c��������. -グループ OX Message/TCPIP/Basic0 の -{\tt ox message\_tag} としては次のものが用意されている. +��違����若�� OX Message/TCPIP/Primitive ��� +{\tt ox message\_tag} ������������罨<��������������������������������. */ -//&eg As {\tt ox message\_tag} the following are provided. +//&eg \noindent As {\tt ox message\_tag} the following are provided. /*&C @plugin/oxMessageTag.h @@ -262,32 +303,33 @@ Thus OX messages are represented as follows. #define OX_DATA_MP 525 #define OX_SYNC_BALL 515 +#define OX_NOTIFY 516 \end{verbatim} */ /*&jp -通信路は 2 つ用意する. -1番目の通信路は +���篆∴君��� 2 ��ょ�����������. +1������������篆∴君��� \verb+ OX_COMMAND + -および +��������� \verb+ OX_DATA + -がながれる. -2番目の通信路 ({\tt control}と呼ぶ) には, -\verb+ OX_COMMAND + およびそれに続くコントロールコマンド +���������������. +2������������篆∴君 ({\tt control}�����若��) ������, +\verb+ OX_COMMAND + ��������潟��������膓������潟�潟�������若����潟����潟�� \verb+ SM_control_* + -またはコントロール関係のデータ, つまり header -\verb+ OX_DATA + ではじまりそれに続く CMO データ -がながれる. -これらをコントロールメッセージおよびコントロールメッセージの結果 -メッセージと呼ぶ. -サンプルサーバでは, この 2 つの通信路を, 2 つのポートを用いて -実現している. +��障�������潟�潟�������若����≫����������若��, ��ゃ�障�� header +\verb+ OX_DATA + ��с�������障�����������膓���� CMO �����若�� +���������������. +��������������潟�潟�������若����<����祉�若�吾�������潟�潟�潟�������若����<����祉�若�吾��腟���� +��<����祉�若�吾����若��. +��泣�潟�������泣�若����с��, ������ 2 ��ゃ�����篆∴君���, 2 ��ゃ�������若�������������� +絎��憗�����������. -\verb+ OX_COMMAND + メッセージは次の形のパケットで表現される: \\ +\verb+ OX_COMMAND + ��<����祉�若�吾��罨<��綵≪�������宴�������ц;�憗��������: \\ */ /*&eg -Two streams are used for communication between a client and a server. +Two streams are provided for communication between a client and a server. One is the stream to exchange data and to send stack machine commands. The other is the stream to control stack machines. Messages on the latter stream are called control messages and @@ -297,6 +339,7 @@ The stack machine command message has the following fo The stack machine command message has the following forms: \\ */ /*&C +\noindent \begin{tabular}{|c|c|} \hline {\tt OX\_COMMAND} & {\tt int32 function\_id} \\ \hline @@ -307,7 +350,7 @@ The stack machine command message has the following fo \\ */ -//&jp \verb+ OX_DATA + メッセージは次の形のパケットで表現される: \\ +//&jp \verb+ OX_DATA + ��<����祉�若�吾��罨<��綵≪�������宴�������ц;�憗��������: \\ //&eg CMO data message has the following form:\\ /*&C \begin{tabular}{|c|c|} @@ -318,7 +361,7 @@ The stack machine command message has the following fo ({\tt OX\_DATA}, {\sl CMObject} data) \\ */ -//&jp コントロールメッセージは次の形のパケットで表現される: \\ +//&jp ��潟�潟�������若����<����祉�若�吾��罨<��綵≪�������宴�������ц;�憗��������: \\ //&eg The control message has the following form:\\ /*&C \begin{tabular}{|c|c|} @@ -329,16 +372,16 @@ The stack machine command message has the following fo \\ */ /*&jp -コントロールメッセージは, 計算を中断したい, debug 用の スレッドを起動する, -debug モードを抜けたい, などの用途に利用する. +��潟�潟�������若����<����祉�若�吾��, 荐�膊����筝�������������, debug ������ ��鴻�����������莎桁��������, +debug ��≪�若�����������������, ������������������������������. */ /*&eg The control message is used to interrupt a computation, to invoke debugging threads, or to exit form the debugging mode. */ -//&jp コントロールメッセージの結果メッセージは次の形のパケットで表現される: \\ -//&eg The result of a cotrol message has the following form:\\ +//&jp ��潟�潟�������若����<����祉�若�吾��腟������<����祉�若�吾��罨<��綵≪�������宴�������ц;�憗��������: \\ +//&eg The result of a control message has the following form:\\ /*&C \begin{tabular}{|c|c|l|} \hline @@ -351,13 +394,13 @@ debugging threads, or to exit form the debugging mode. /*&jp {\tt int32 function\_id} -の部分に, サーバスタックマシン の operator に対応する番号がはいる. -グループ SMobject/Basic0 および SMobject/Basic1 に属する -タグとして以下のものがある. +������������, ��泣�若����鴻�帥����������激�� ��� operator ���絲上������������垩�����������. +��違����若�� SMobject/Primitive ��������� SMobject/Basic ���絮������� +��帥�違��������篁ヤ��������������������. */ /*&eg {\tt int32 function\_id} is the value of a stack machine command. -SM tags in SMobject/Basic0 and SMobject/Basic1 and corresponding +SM tags in SMobject/Primitive and SMobject/Basic and corresponding values are as follows. */ /*&C @@ -381,21 +424,22 @@ values are as follows. #define SM_getsp 275 #define SM_dupErrors 276 +#define SM_nop 300 /* do nothing */ #define SM_control_kill 1024 #define SM_control_reset_connection 1030 \end{verbatim} */ -//&jp たとえば, -//&eg For example -/*C +//&jp \noindent ������������, +//&eg \noindent For example +/*&C \begin{center} (OX\_COMMAND, SM\_pops) \end{center} */ -//&jp は -//&eg is encoded as follows. +//&jp \noindent ��� +//&eg \noindent is encoded as follows. /*&C \begin{center} \begin{tabular}{|c|c|} @@ -405,14 +449,14 @@ values are as follows. \end{tabular} \end{center} */ -//&jp とエンコードされる. +//&jp ��������潟�潟�若�����������. /*&jp -operator の詳細は次の節で説明する. -これらの定数の名前はインプリメントのとき短縮形で表現してもよい. +operator ���荅括完���罨<��膀���ц�����������. +������������絎���違�������������ゃ�潟�������<�潟��������������膰�綵≪�ц;�憗��������������. */ /*&eg -The details of the operators are described in Section \ref{sec:stackmanine}. -Names of these constants may be represented by abbrebiated forms. +The details of the operators are described in Section \ref{sec:stackmachine}. +Names of these constants may be represented by abbreviated forms. */