1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft Internet Assistant for PowerPoint 97">
<TITLE>Example - Sharing Memory</TITLE>
</HEAD>
<BODY >
<H1>Example - Sharing Memory</H1>
<P><UL>
<LI><H2>Data can be shared with nsv variables:</H2>
</UL></P>
<P><UL>
proc my.thread {host} {
</UL><UL>
nsv_set pages $host [ open socket, fetch page ]
</UL><UL>
}
</UL><UL>
</UL><UL>
foreach host {host1 host2 host3 host4} {
</UL><UL>
lappend tids [ns_thread begin my.thread $host"]
</UL><UL>
}
</UL><UL>
foreach tid $tids {ns_thread wait $tid}
</UL><UL>
</UL><UL>
foreach host {host1 host2 host3 host4} {
</UL><UL>
data available via [nsv_get pages $host]
</UL><UL>
}</UL></P>
<P></P>
<P>
<TABLE>
<TD HEIGHT=100 WIDTH=100> <A HREF="tsld038.htm">Previous slide</A> </TD>
<TD HEIGHT=100 WIDTH=100> <A HREF="tsld040.htm">Next slide</A> </TD>
<TD HEIGHT=100 WIDTH=150> <A HREF="tsld001.htm">Back to first slide</A> </TD>
<TD HEIGHT=100 WIDTH=150> <A HREF="sld039.htm">View graphic version</A> </TD>
</TABLE>
<BR>
</P>
</Body>
</HTML>
|