chenshijun
2020-04-24 b4f186a5d496fd2085a2bf1405a6384cd7802236
shmqueue.go
@@ -12,7 +12,7 @@
)
const (
   TimePeriodPutOrGet = time.Duration(5) * time.Microsecond
   TimePeriodPutOrGet = time.Duration(5)*time.Millisecond //ms
)
//Element info
@@ -189,8 +189,8 @@
   }
   //todo
   if posCnt >= capMod-1 {
   //if posCnt >= capMod {
   //if posCnt >= capMod-1 {
   if posCnt >= capMod {
      runtime.Gosched()
      return false, int(posCnt)
   }
@@ -204,8 +204,6 @@
   cache = &(eqi.EsCaches[putPosNew&capMod])
   //tryMax := 100
   //tryCount := 0
   for {
      getNo := atomic.LoadUint32(&cache.getNo)
      putNo := atomic.LoadUint32(&cache.putNo)
@@ -216,10 +214,6 @@
      } else {
         runtime.Gosched()
      }
      //tryCount++
      //if tryCount >= tryMax {
      //   return false, int(posCnt)
      //}
   }
}
@@ -301,8 +295,6 @@
   cache = &(eqi.EsCaches[getPosNew&capMod])
   //tryMax := 100
   //tryCount := 0
   for {
      getNo := atomic.LoadUint32(&cache.getNo)
      putNo := atomic.LoadUint32(&cache.putNo)
@@ -314,10 +306,6 @@
      } else {
         runtime.Gosched()
      }
      //tryCount++
      //if tryCount >= tryMax {
      //   return ElemInfo{}, false, int(posCnt)
      //}
   }
}