From 2ad7b552e1df4c7ef5194e1a4a6f2d8aa0001288 Mon Sep 17 00:00:00 2001 From: stephey Date: Sun, 26 Sep 2010 05:22:59 +0000 Subject: [PATCH] removed locking for waitingQueue add since it's not really needed. --- .../mlp/stephen/Testing_WaitingQueue/WaitingQueue.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Robust/src/Tests/mlp/stephen/Testing_WaitingQueue/WaitingQueue.c b/Robust/src/Tests/mlp/stephen/Testing_WaitingQueue/WaitingQueue.c index 4bf4af55..55cd2071 100644 --- a/Robust/src/Tests/mlp/stephen/Testing_WaitingQueue/WaitingQueue.c +++ b/Robust/src/Tests/mlp/stephen/Testing_WaitingQueue/WaitingQueue.c @@ -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. void putWaitingQueue(int allocSiteID, WaitingQueueBin * queue, int effectType, void * resumePtr, int traverserID) { //lock bin - WaitingQueueBinVector * head; WaitingQueueBinVector * currentVector; TraverserResumeDataFromWaitingQ * b; - do { - head = (WaitingQueueBinVector *) 0x1; - head = LOCKXCHG(&(queue[allocSiteID]).head, head); - } while (head == (WaitingQueueBinVector *) 0x1); + + + //since Put SHOULD be done only by 1 thread (from 1 hashtable), the locking mechanism is removed. + WaitingQueueBinVector * head = queue[allocSiteID].head; +// do { +// head = (WaitingQueueBinVector *) 0x1; +// head = LOCKXCHG(&(queue[allocSiteID]).head, head); +// } while (head == (WaitingQueueBinVector *) 0x1); //now the current bin is locked. //completely empty case -- 2.34.1