Below is the list of changes that have just been committed into a local
6.0 repository of jas. When jas does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2008-05-14 18:31:23-04:00, jas@stripped +2 -0
Played around with SyncObject backoff strategy.
storage/falcon/SyncObject.cpp@stripped, 2008-05-14 18:31:19-04:00, jas@stripped +4 -3
Played around with SyncObject backoff strategy.
storage/falcon/SyncTest.cpp@stripped, 2008-05-14 18:31:19-04:00, jas@stripped +6 -1
Eliminated some detail from report; added average number
of successful cycles.
diff -Nrup a/storage/falcon/SyncObject.cpp b/storage/falcon/SyncObject.cpp
--- a/storage/falcon/SyncObject.cpp 2008-05-14 15:48:42 -04:00
+++ b/storage/falcon/SyncObject.cpp 2008-05-14 18:31:19 -04:00
@@ -55,7 +55,7 @@
else\
{ thread = Thread::getThread("SyncObject::lock"); thread->backoff = BACKOFF_INTERVAL; }
-#define BACKOFF_INTERVAL (thread->random % 100)
+#define BACKOFF_INTERVAL (thread->random % 1000)
#ifdef TRACE_SYNC_OBJECTS
@@ -733,9 +733,10 @@ int SyncObject::getCollisionCount(void)
void SyncObject::backoff(Thread* thread)
{
//thread->sleep(1);
+ int a = 0;
for (int n = 0; n < thread->backoff; ++n)
- ;
+ ++a;
- thread->backoff += thread->backoff;
+ thread->backoff += a;
}
diff -Nrup a/storage/falcon/SyncTest.cpp b/storage/falcon/SyncTest.cpp
--- a/storage/falcon/SyncTest.cpp 2008-05-14 15:48:43 -04:00
+++ b/storage/falcon/SyncTest.cpp 2008-05-14 18:31:19 -04:00
@@ -43,6 +43,7 @@ void SyncTest::test()
Sync sync(&starter, "SyncTest::test");
Threads *threadBarn = new Threads(NULL, MAX_THREADS);
+ int grandTotal = 0;
for (int n = 1; n <= MAX_THREADS; ++n)
{
@@ -85,14 +86,18 @@ void SyncTest::test()
for (thd = 0; thd < n; ++thd)
total += threads[thd].count;
- printf("%d threads, %d cycles, %d collisions:", n, total, syncObject.getCollisionCount() - collisions);
+ grandTotal += total;
+ printf("%d threads, %d cycles, %d collisions\n", n, total, syncObject.getCollisionCount() - collisions);
+ /***
for (thd = 0; thd < n; ++thd)
printf(" %d", threads[thd].count);
printf("\n");
+ ***/
}
+ printf ("Average cycles %d\n", grandTotal / MAX_THREADS);
threadBarn->shutdownAll();
threadBarn->waitForAll();
threadBarn->release();
| Thread |
|---|
| • bk commit into 6.0 tree (jas:1.2672) | Jim Starkey | 15 May |