Many thanks for your reply Ravi.
I assume from the behaviour of the code below that __tm_retry simply spins rather than waiting for a change in the object state? Is there a simple way around this?
__attribute__((tm_callable))
void Queue::enq (int v) {
__tm_atomic {
// queue is full
if (count==MAX_LEN) __tm_retry;
buf[tail]=v;
if (++tail == MAX_LEN) tail=0;
count++;
}
// cout << "enq" << endl;
}
__tm_retry was provided as an experimental hoping to get user feedback on the use case for this language extension. So not much time was spend on an optimal implementation.