removed locking for waitingQueue add since it's not really needed.
authorstephey <stephey>
Sun, 26 Sep 2010 05:22:59 +0000 (05:22 +0000)
committerstephey <stephey>
Sun, 26 Sep 2010 05:22:59 +0000 (05:22 +0000)
Robust/src/Tests/mlp/stephen/Testing_WaitingQueue/WaitingQueue.c

index 4bf4af55115db366dbfa14937a870b58ff462790..55cd207111407aec851c8ac60563962506c02081 100644 (file)
@@ -21,13 +21,16 @@ WaitingQueueBin * mallocWaitingQueue(int size) {
 //NOTE: allocSiteID is NOT the same as allocsite, rather it's an ID generated by the traverser for an alloc site for a traversal.\r
 void putWaitingQueue(int allocSiteID, WaitingQueueBin * queue, int effectType, void * resumePtr, int traverserID) {\r
   //lock bin\r
-  WaitingQueueBinVector * head;\r
   WaitingQueueBinVector * currentVector;\r
   TraverserResumeDataFromWaitingQ * b;\r
-  do {\r
-    head = (WaitingQueueBinVector *) 0x1;\r
-    head = LOCKXCHG(&(queue[allocSiteID]).head, head);\r
-  } while (head == (WaitingQueueBinVector *) 0x1);\r
+\r
+\r
+  //since Put SHOULD be done only by 1 thread (from 1 hashtable), the locking mechanism is removed.\r
+  WaitingQueueBinVector * head = queue[allocSiteID].head;\r
+//  do {\r
+//    head = (WaitingQueueBinVector *) 0x1;\r
+//    head = LOCKXCHG(&(queue[allocSiteID]).head, head);\r
+//  } while (head == (WaitingQueueBinVector *) 0x1);\r
   //now the current bin is locked.\r
 \r
   //completely empty case\r