# Example - Sharing Memory

- ## Data can be shared with nsv variables:

proc my.thread {host} {

nsv_set pages $host [… open socket, fetch page …]

}

foreach host {host1 host2 host3 host4} {

lappend tids [ns_thread begin ”my.thread $host"]

}

foreach tid $tids {ns_thread wait $tid}

foreach host {host1 host2 host3 host4} {

… data available via [nsv_get pages $host] …

}

Previous slide | Next slide | Back to first slide | View graphic version