SpinLocked
BAN USER
Comments (4)
Reputation 10
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
for(i=0; i< NUM_ELEM; i++)
{
temp = a[i];
if(a[temp] / (NUM_ELEM+1) > 0)
{
// if you just want to find the repeating element
cout<< "the repeating element is"<<temp;
break;
}
a[temp] += (NUM_ELEM + 1);
}
Comment hidden because of low score. Click to expand.
-2
of 4 vote
for(i=0; i< NUM_ELEM; i++)
{
temp = a[i];
if(a[temp] / (NUM_ELEM+1) > 0)
{
// if you just want to find the repeating element
cout<< "the repeating element is"<<temp;
break;
}
a[temp] += (NUM_ELEM + 1);
}
Comment hidden because of low score. Click to expand.
0
of 0 vote
what do u mean by "critical sections"??
- SpinLocked January 21, 2012Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
knowingly or unknowingly you gave one good answer.. "CRITICAL_SECTION" in MicroSoft Windows is like futex in Linux..
- SpinLocked February 22, 2012Futexes are userspace locks can be used for coarse lockings... esp.synchronization between multiple threads.. the same applies to CRITICAL_SECTION..
My ignorance..