home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / fj / comp / parallel / 182 < prev    next >
Encoding:
Text File  |  1993-01-26  |  4.7 KB  |  117 lines

  1. Path: sparky!uunet!ccut!news.u-tokyo.ac.jp!enterprise!keisu3!take
  2. From: take@wadalab.t.u-tokyo.ac.jp (Mikio Takeuchi)
  3. Newsgroups: fj.comp.parallel
  4. Subject: Re: why does transputer(c)'s i/o function busywaiting?
  5. Message-ID: <TAKE.93Jan26190337@tomo.wadalab.t.u-tokyo.ac.jp>
  6. Date: 26 Jan 93 10:03:37 GMT
  7. References: <TAKE.93Jan25210050@tomo.wadalab.t.u-tokyo.ac.jp>
  8.     <NITTA.93Jan25233312@ns.c.u-tokyo.ac.jp>
  9. Sender: news@keisu-s.t.u-tokyo.ac.jp
  10. Reply-To: take@wadalab.t.u-tokyo.ac.jp
  11. Distribution: fj
  12. Organization: Wada Lab., Dept. of Information Engineering, University of Tokyo,
  13.     Japan
  14. Lines: 99
  15. In-Reply-To: nitta@c.u-tokyo.ac.jp's message of 25 Jan 93 14:33:12 GMT
  16. Nntp-Posting-Host: tomo
  17.  
  18. $@ElBg$NC]Fb$G$9!#?7ED$5$s!"$*5W$7$V$j$G$9!#(J
  19.  
  20. $@65$($F$$$?$@$$$?J}K!$r;n$7$F$_$^$7$?!#35$M$&$^$/F0$$$F$$$k$N$G$9$,!"$$(J
  21. $@$/$D$+LdBjE@$,=P$F$-$^$7$?!#(J
  22.  
  23. $@$^$:$O(Jpollkey()$@$O(JCTRL-C$@$bDL>o$N%5!<%P$KBP$9$k3d$j9~$_$G$O$J$/$F(J3$@$rJV$7(J
  24. $@$F$7$^$&E@$G$9!#$3$l$O(Jfgetc_poll()$@$NCf$G%A%'%C%/$9$k$3$H$GBP=h$G$-$^$9(J
  25. $@$+$i<B$O$"$^$jLdBj$G$O$"$j$^$;$s!#(J
  26.  
  27. $@$b$&0l$D$NLdBj$O!"(Jpollkey()$@$rMQ$$$k$H!"(J\n$@$N07$$$,JQ$o$C$F$7$^$&E@$G$9!#(J
  28.  
  29. $@Nc$($P<!$N%W%m%0%i%`!"!J(Jfgets_poll.c$@$O5-;v$+$i@Z$jH4(J$@$$$?$=$N$^$^$G$9!K(J
  30. #include <stdio.h>
  31. #include <process.h>
  32. #include "fgets_poll.c"
  33.  
  34. void recv(Process *self)
  35. {
  36.     char    buf[256];
  37.     self = self;
  38.     while (1)
  39.         /*gets(buf);*/
  40.         fgets_poll(buf,256,stdin);
  41. }
  42.  
  43. void send(Process *self)
  44. {
  45.     char    *msg = "This is send\nhoehoe";
  46.     self = self;
  47.     while (1) {
  48.         puts(msg);
  49.         fflush(stdout);
  50.     }
  51. }
  52.  
  53. int main(void)
  54. {
  55.     Process *p0, *p1;
  56.     char    *msg = "This is main\nhoehoe";
  57.  
  58.     puts(msg);
  59.     p0 = ProcAlloc(send, 0, 0);
  60.     p1 = ProcAlloc(recv, 0, 0);
  61.     ProcRun(p1);
  62.     ProcRun(p0);
  63.  
  64.     while (1)
  65.         ProcReschedule();
  66.     return 1;
  67. }
  68.  
  69. $@$r<B9T$9$k$HF@$i$l$k7k2L$O<!$N$h$&$K$J$j$^$9!#(J
  70. $@!J%3%s%=!<%k(J$@$X$N=PNO$r(Jscript(1)$@$GC%$C$F!"(Jod -c$@$G%@%s%W$7$?$b$N$G$9!#!K(J
  71.  
  72. 0000000    S   c   r   i   p   t       s   t   a   r   t   e   d       o
  73. 0000020    n       T   u   e       J   a   n       2   6       1   8   :
  74. 0000040    4   8   :   3   8       1   9   9   3  \n   t   a   k   e   @
  75. 0000060    s   h   i   g   e   [   1   ]   %       i   s   e   r   v   e
  76. 0000100    r       -   s   b       i   o   .   b   t   l  \r  \r  \n   B
  77. 0000120    o   o   t   i   n   g       r   o   o   t       t   r   a   n
  78. 0000140    s   p   u   t   e   r   .   .   .   |  \b   /  \b   -  \b   \
  79. 0000160   \b  \r                                                        
  80. 0000200                                                       \r   T   h
  81. 0000220    i   s       i   s       m   a   i   n  \r  \n   h   o   e   h
  82.                                                 $@!v$3$3$H!v(J
  83. 0000240    o   e  \r  \n   T   h   i   s       i   s       s   e   n   d
  84. 0000260   \n   h   o   e   h   o   e  \n   f   T   h   i   s       i   s
  85.      $@!v$3$3$G$9(J$@!v(J
  86. 0000300        s   e   n   d  \n   h   o   e   h   o   e  \n   o   T   h
  87. 0000320    i   s       i   s       s   e   n   d  \n   h   o   e   h   o
  88. 0000340    e  \n   o   T   h   i   s       i   s       s   e   n   d  \n
  89. 0000360    h   o   e   h   o   e  \n  \n   T   h   i   s       i   s    
  90. 0000400    s   e   n   d  \n   h   o   e   h   o   e  \n   b   T   h   i
  91. 0000420    s       i   s       s   e   n   d  \n   h   o   e   h   o   e
  92. 0000440   \n   a   T   h   i   s       i   s       s   e   n   d  \n   h
  93. 0000460    o   e   h   o   e  \n   r   T   h   i   s       i   s       s
  94. 0000500    e   n   d  \n   h   o   e   h   o   e  \n  \n   T   h   i   s
  95. 0000520        i   s       s   e   n   d  \n   h   o   e   h   o   e  \n
  96. 0000540  003   T   h   i   s       i   s       s   e   n   d  \n   h   o
  97.    $@!v$3$3$O(JCTRL-C$@!v(J
  98. 0000560    e   h   o   e  \n 003   T   e   r   m   i   n   a   t   e   d
  99. 0000600   \n   t   a   k   e   @   s   h   i   g   e   [   2   ]   %    
  100. 0000620    e   x   i   t  \r  \r  \n   e   x   i   t  \r  \n  \n   s   c
  101. 0000640    r   i   p   t       d   o   n   e       o   n       T   u   e
  102. 0000660        J   a   n       2   6       1   8   :   4   9   :   3   5
  103. 0000700        1   9   9   3  \n  \n   s   c   r   i   p   t       d   o
  104. 0000720    n   e       o   n       T   u   e       J   a   n       2   6
  105. 0000740        1   8   :   4   9   :   3   5       1   9   9   3  \n
  106. 0000757
  107.  
  108. $@MW$9$k$K!"(Jpollkey()$@$r;H$&$H:#$^$G(J\n$@$G(J\r\n$@$N%7!<%1%s%9$,=PNO$5$l$F$$$?(J
  109. $@$N$,(J\n$@$@$1$7$+=PNO$5$l$J$/$J$C(J$@$F$7$^$&$N$G$9!#(Jprintf, puts. putc$@$J$I$,(J
  110. $@A4$F1F6A$r$&$1$k$_$?$$$J$N$G!"A4It=q$-49$($k$N$O$A$g$C$H%7%s(J$@%I%$$G$9!#(J
  111. $@:#$3$NLdBj$KHq$d$7$F$$$k;~4V$,$"$^$j$J$$$N$G!"$^$?2K$K$J$C$?$i$d$j$?$$(J
  112. $@$H;W$$$^$9!#(J
  113.  
  114. $@$I$&$b(J$@M-Fq$&$4$6$$$^$7$?!#(J
  115. --
  116. // $@El5~Bg3XBg3X1!9)3X7O8&5f2J(J $@7W?t9)3X@l96(J $@C]Fb44M:(J
  117.