/[resiprocate]/main/rutil/test/sweepRandom.sh
ViewVC logotype

Annotation of /main/rutil/test/sweepRandom.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9043 - (hide annotations) (download) (as text)
Mon Feb 28 17:40:21 2011 UTC (8 years, 10 months ago) by kwhite
File MIME type: application/x-sh
File size: 1003 byte(s)
Improve rutil Random class

* Add new mode RESIP_RANDOM_THREAD_MUTEX
* Add new mode RESIP_RANDOM_THREAD_LOCAL
* Add test program testRandomThread.cxx
* Add test script sweepRandom.sh
* Add configure support for RANDOM_THREAD_LOCAL option. Configure option
  "random-thread-local" can be used to manually control. By default,
  off.
* Clarify return value of getRandom (31bits, positive)
* Optimize the RtlGenRandom() path (avoid useless bit munging)
1 kwhite 9043 #!/bin/bash
2     set -e
3    
4     # Basic idea to use on POSIX platforms:
5     # 1. Build default tree (rutil & rutil/tests) with optmization
6     # 2. cp tests/testRandomThread to tests/testRandomThread.random
7     # 3. Change Random.hxx to define THREAD_MUTEX, rebuild and copy to testRandomThread.mutex
8     # 3. Change Random.hxx to define THREAD_LOCAL, rebuild and copy to testRandomThread.local
9    
10     numCycles=10
11    
12     ProgBase=./testRandomThread
13     KnownFlavors="none random mutex local"
14     RunFlavors="random mutex local"
15    
16     for flavor in $KnownFlavors; do
17     if [ "$1" = $flavor ] ; then
18     RunFlavors=$flavor
19     shift
20     continue
21     fi
22     done
23    
24     if [ "$1" != "" ] ; then
25     echo "Uknown option: $1"
26     exit 1
27     fi
28    
29     for flavor in $RunFlavors; do
30     Prog=$ProgBase
31     if [ $flavor != "none" ] ; then
32     Prog=$ProgBase.$flavor
33     fi
34     if [ ! -x $Prog ] ; then
35     echo "Program $Prog is missing; skipping..."
36     continue
37     fi
38    
39     echo "Sweeping $Prog ..."
40     for numThreads in -1 0 1 3 9 27; do
41     $Prog $numCycles $numThreads
42     done
43     done

Properties

Name Value
svn:executable *

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27