diff options
author | georgeps <georgeps> | 2008-05-09 05:07:37 (GMT) |
---|---|---|
committer | georgeps <georgeps> | 2008-05-09 05:07:37 (GMT) |
commit | 8c6b0215a7ccebe49708b68c096c93ae84113fb6 (patch) | |
tree | 91be3b2c8782dc2cb72fc73b7d113d37aac28884 /tools/tsdPerf.tcl | |
parent | e782414ad0af468115d69e437d0d70c5895287ff (diff) | |
download | tcl-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.tcl | 24 |
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" +} |