in <multi threaded> programming( maybe threadcount is 100 )
1. map
std::map< long,DATA > testMap[100];
LockObject lock[100];
ThreadProc()
{
long lSerial = rand();
long lHashSerial = lSerial%100;
DATA sData;
// LockStart
{
LockObejct lock( lock[100] );
testMap[lHashSerial] = sData
}
// LockEnd
}
2. hashmap
stdext::hashmap< long, DATA > testHashMap;
LockObject lock;
ThreadProc()
{
long lSerial = rand();
DATA sData;
// LockStart
{
LockObejct lock( lock );
testHashMap[lSerial] = sData
}
// LockEnd
}
which is more perfermance?
1 or 2
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]