summaryrefslogtreecommitdiffstats
path: root/tools/tsdPerf.tcl
diff options
context:
space:
mode:
authorgeorgeps <georgeps>2008-05-09 05:07:37 (GMT)
committergeorgeps <georgeps>2008-05-09 05:07:37 (GMT)
commit8c6b0215a7ccebe49708b68c096c93ae84113fb6 (patch)
tree91be3b2c8782dc2cb72fc73b7d113d37aac28884 /tools/tsdPerf.tcl
parente782414ad0af468115d69e437d0d70c5895287ff (diff)
downloadtcl-8c6b0215a7ccebe49708b68c096c93ae84113fb6.zip
tcl-8c6b0215a7ccebe49708b68c096c93ae84113fb6.tar.gz
tcl-8c6b0215a7ccebe49708b68c096c93ae84113fb6.tar.bz2
* tools/tsdPerf.c A loadable Tcl extension for testing TSD
performance. * tools/tsdPerf.tcl A simplistic tool that uses the thread extension and tsdPerf.so to get some performance metrics by, simulating, simple TSD contention.
Diffstat (limited to 'tools/tsdPerf.tcl')
-rw-r--r--tools/tsdPerf.tcl24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/tsdPerf.tcl b/tools/tsdPerf.tcl
new file mode 100644
index 0000000..c2d74c9
--- /dev/null
+++ b/tools/tsdPerf.tcl
@@ -0,0 +1,24 @@
+
+package require Thread
+
+set ::tids [list]
+for {set i 0} {$i < 4} {incr i} {
+ lappend ::tids [thread::create [string map [list IVALUE $i] {
+ set curdir [file dirname [info script]]
+ load [file join $curdir tsdPerf.so]
+
+ while 1 {
+ tsdPerfSet IVALUE
+ }
+ }]]
+}
+
+puts TIDS:$::tids
+
+set curdir [file dirname [info script]]
+load [file join $curdir tsdPerf.so]
+
+tsdPerfSet 1234
+while 1 {
+ puts "TIME:[time {set value [tsdPerfGet]} 1000] VALUE:$value"
+}