}
//consider SPEC flag
-
int rcr_WRITEBINCASE(HashStructure *T, void *ptr, SESEcommon *task, int index) {
//chain of bins exists => tail is valid
//if there is something in front of us, then we are not ready
T->array[key].head=val;//released lock
}
-rcr_RETIREHASHTABLE(HashStructure *T, SESEcommon *task, int key) {
+void rcr_RETIREHASHTABLE(HashStructure *T, SESEcommon *task, int key) {
BinElement_rcr * be = &(T->array[key]);
BinItem_rcr *b=be->head;
if (ptr->status==NOTREADY) {
ReadBinItem_rcr* rptr=(ReadBinItem_rcr*)ptr;
for (i=0;i<rptr->index;i++) {
- RESOLVE(rptr->array[i]);
+ TaskDescriptor * td=&rptr->array[i];
+ RESOLVE(td->task, td->bitindex);
if (((INTPTR)rptr->array[i].task)&PARENTBIN) {
//parents go immediately
atomic_dec(&rptr->item.total);
break;
if(ptr->status==NOTREADY) {
WriteBinItem_rcr* wptr=(WriteBinItem_rcr*)ptr;
- RESOLVE(wptr);
+ RESOLVE(wptr->task, wptr->bitindexwr);
ptr->status=READY;
if(((INTPTR)wptr->task)&PARENTBIN) {
val=val->next;
be->head=val; // release lock
}
}
+
+void RESOLVE(SESEcommon *record, bitvt mask) {
+ int index=-1;
+ struct rcrRecord * array=(struct rcrRecord *)(((char *)record)+record->common.offsetToParamRecords);
+ while(mask!=0) {
+ int shift=__builtin_ctzll(mask)+1;
+ index+=shift;
+ if (atomic_sub_and_test(1,&array[index].count)) {
+ inf flag=LOCKXCHG(&array[index].flag,0);
+ if (flag) {
+ if(atomic_sub_and_test(1, &(record->common.unresolvedDependencies)))
+ workScheduleSubmit((void *)record);
+ }
+ }
+ mask=mask>>shift;
+ }
+}