🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

3 total messages Started by Kikutani Makoto Wed, 03 Dec 1997 00:00
reading data from parent process without blocking
#210
Author: Kikutani Makoto
Date: Wed, 03 Dec 1997 00:00
50 lines
1914 bytes
$B$-$/$?$K$G$9!#(B

Tcl/Tk $B$r$h$&$d$/=q$1$k$h$&$K$J$C$F$-$?$+!"$H$$$&%l%Y%k$G<ALd$G$9!#(B

$B%7%_%e%l!<%?$+$i!"(Bwish$B$r;R%W%m%;%9$G5/F0$7!"(BTcl$B%9%/%j%W%H$r(B
$BAv$i$;$F$^$9!#(B

Tcl$B%9%/%j%W%H$O?F%W%m%;%9$+$i$N%G!<%?$r(Bread$B$GFI$_!"(B
$B%0%i%U$rIA2h$7$F9T$-$^$9!#(B

$B$*$*$6$C$Q$J%"%k%4%j%:%`$O(B

while {1} {
    $B?F%W%m%;%9$+$i(Bread
    if {$B%G!<%?(B} {
        $BIA2h(B
    } elseif {$B=*N;(B} {
        break
    } elseif {$B%9%H%C%W(B} {
        while {1} {
            $B?F%W%m%;%9$+$i(Bread
            if {$B:F3+%7%0%J%k(B} {
	       break
	    } else {
	       $B%f!<%6$N=hM}BT$A(B
	    }
	}
    } elseif {...} {
        .....
        .....
}

$B$H$$$&$H$3$m$G$9$,!"LdBj$O%7%_%e%l!<%?$+$i%9%H%C%W%7%0%J%k(B
$B$,Mh$F!"%f!<%6$K:n6H(B($B%9%/%m!<%k$H$+%W%m%C%H(B)$B$r$5$;$?$$$H$3$m$G$9!#(B
$B:#$O(Bread$B$,%V%m%C%/$7$F$k$N$G2?$b$G$-$^$;$s!#(B

fconfigure stdin -blocking 0 $B$H$+$7$F(B fblocked $B$r;H$C$F(B
$B$d$k$N$+$H$b;W$$$^$7$?$,!#%$%^%$%A;H$$J}$,$o$+$j$^$;$s!#(B
$B%9%^!<%H$JJ}K!$O$"$k$G$7$g$&$+!)(B

ruby/Tk$B$G=q$$$F$?$N$r!"(BTcl/Tk$B$G=q$-D>$9$H$$$&L/$J$3$H$r(B
$B$d$C$F$k$N$G$9$,!"(Bruby$B$@$H>e$NA4BN$N%k!<%W$r(Bthread$B$N$[$&$G(B
$B$d$i$;$F$k$N$G!"2?$b9M$($J$/$F$$$$$N$G$9!#(B

-- 
$B?M@8$rGXIi$$Ej$2(B

$B5FC+(B $B@?(B(Kikutani Makoto)  kikutani@eis.or.jp hgf03701@niftyserve.or.jp
                          http://www.eis.or.jp/muse/kikutani/
Re: reading data from parent process without blocking
#216
Author: Kenji Sugita
Date: Thu, 04 Dec 1997 00:00
70 lines
2883 bytes
;;; In article <663njq$ci4$1@kiku.eis.or.jp> kikutani@eis.or.jp (Kikutani Makoto) writes:
;;; 
;;;    $B$-$/$?$K$G$9!#(B

  $B$3$s$P$s$O!#(B

;;;    Tcl/Tk $B$r$h$&$d$/=q$1$k$h$&$K$J$C$F$-$?$+!"$H$$$&%l%Y%k$G<ALd$G$9!#(B
;;; 
;;;    $B%7%_%e%l!<%?$+$i!"(Bwish$B$r;R%W%m%;%9$G5/F0$7!"(BTcl$B%9%/%j%W%H$r(B
;;;    $BAv$i$;$F$^$9!#(B
;;; 
;;;    Tcl$B%9%/%j%W%H$O?F%W%m%;%9$+$i$N%G!<%?$r(Bread$B$GFI$_!"(B
;;;    $B%0%i%U$rIA2h$7$F9T$-$^$9!#(B
;;; 
;;;    $B$*$*$6$C$Q$J%"%k%4%j%:%`$O(B
;;; 
;;;    while {1} {
;;;        $B?F%W%m%;%9$+$i(Bread
;;;        if {$B%G!<%?(B} {
;;; 	   $BIA2h(B
;;;        } elseif {$B=*N;(B} {
;;; 	   break
;;;        } elseif {$B%9%H%C%W(B} {
;;; 	   while {1} {
;;; 	       $B?F%W%m%;%9$+$i(Bread
;;; 	       if {$B:F3+%7%0%J%k(B} {
;;; 		  break
;;; 	       } else {
;;; 		  $B%f!<%6$N=hM}BT$A(B
;;; 	       }
;;; 	   }
;;;        } elseif {...} {
;;; 	   .....
;;; 	   .....
;;;    }
;;; 
;;;    $B$H$$$&$H$3$m$G$9$,!"LdBj$O%7%_%e%l!<%?$+$i%9%H%C%W%7%0%J%k(B
;;;    $B$,Mh$F!"%f!<%6$K:n6H(B($B%9%/%m!<%k$H$+%W%m%C%H(B)$B$r$5$;$?$$$H$3$m$G$9!#(B
;;;    $B:#$O(Bread$B$,%V%m%C%/$7$F$k$N$G2?$b$G$-$^$;$s!#(B
;;; 
;;;    fconfigure stdin -blocking 0 $B$H$+$7$F(B fblocked $B$r;H$C$F(B
;;;    $B$d$k$N$+$H$b;W$$$^$7$?$,!#%$%^%$%A;H$$J}$,$o$+$j$^$;$s!#(B
;;;    $B%9%^!<%H$JJ}K!$O$"$k$G$7$g$&$+!)(B

  $B?F%W%m%;%9$+$i$I$l$/$i$$$N%G!<%?$,Mh$k$N$+J,$+$j$^$;$s$,!"?F%W%m%;%9$+(B
$B$i$NF~NO$r(B fileevent (Tk4.0 $B0J>e(B) $B$G<u$1$F=hM}$9$k$H$$$&$N$G$O$I$&$G$7$g(B
$B$&$+!#(B

  fileevent $B$r;H$&(B Tk $B%W%m%0%i%`$r4^$a$F(B 4 $B$D$N%W%m%;%9$r0J2<$N$h$&$K$7(B
$B$F@)8f$7!"(BTk $B%W%m%0%i%`$G$O!"B>$N%W%m%;%9$,=hM}Cf$G$b!"2hLLA`:n$r$G$-$k(B
$B$h$&$K$7$F$$$^$9!#(B

	$B%W%m%;%9(BA: C $B%W%m%0%i%`(B Motif$B!#%W%m%;%9(BB$B$K%3%^%s%I$rAw$j!"=*N;(B
	    |^     $BDLCN$rLc$&!#(B
	    ||
	    ||
	    V|
	$B%W%m%;%9(BB: Tk $B%W%m%0%i%`!#(Bfileevent $B$G%W%m%;%9(BA $B$+$i$N%3%^%s%I$r(B
	    |^	   $BHsF14|$K=hM}!#(Bfileevent $B$GHsF14|$K%W%m%;%9(BC$B!"(BD $B$K%3%^(B
	    ||     $B%s%I$r=P$7!"7k2L$rF@$k!#%f!<%6$NA`:n$G!"%9%/%m!<%kEy(B
	    ||     $B$r$7$F$$$k!#(B
	    V|
	$B%W%m%;%9(BC$B!"(BD: C $B%W%m%0%i%`!#%W%m%;%9(BB $B$+$i$N%3%^%s%I$r=hM}!#(B
--


Kenji Sugita
sugita@sra.co.jp
http://www.sra.co.jp/people/sugita/
Re: reading data from parent process without blocking
#218
Author: Kikutani Makoto
Date: Mon, 08 Dec 1997 00:00
32 lines
1354 bytes
$B$-$/$?$K$G$9!#(B

Kenji Sugita<sugita@sra.co.jp>$B$5$s$O(B
$B5-;v(B<SUGITA.97Dec4185334@sran362.sra.co.jp>$B$G$3$&=q$-$^$7$?(B:

>   $B?F%W%m%;%9$+$i$I$l$/$i$$$N%G!<%?$,Mh$k$N$+J,$+$j$^$;$s$,!"?F%W%m%;%9$+(B
> $B$i$NF~NO$r(B fileevent (Tk4.0 $B0J>e(B) $B$G<u$1$F=hM}$9$k$H$$$&$N$G$O$I$&$G$7$g(B
> $B$&$+!#(B

$B$3$N%3%^%s%I$OCN$j$^$;$s$G$7$?!#(B
$B$3$s$J46$8$G;H$&$N$G$9$M!#(B
------------------------------
text .t
pack .t

proc loop {} {
    set str [gets stdin]
    .t insert end $str
}

fileevent stdin readable loop
------------------------------

$B$^$5$K$3$l$,;d$N5a$a$F$$$?$b$N$G$7$?!#(B
$B$"$j$,$H$&$4$6$$$^$7$?!#(B

-- 
$B?M@8$rGXIi$$Ej$2(B

$B5FC+(B $B@?(B(Kikutani Makoto)  kikutani@eis.or.jp hgf03701@niftyserve.or.jp
                          http://www.eis.or.jp/muse/kikutani/
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads