__tm_retry (ICC Prototype STM support)

__tm_retry (ICC Prototype STM support)

Is there a public document that describes the STM API in detail? is "__tm_retry" part of the API? If so, what is its behaviour precisely? Many thanks for any help.

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Quoting - Robert Mullins
Is there a public document that describes the STM API in detail? is "__tm_retry" part of the API? If so, what is its behaviour precisely? Many thanks for any help.

__tm_retry is provided as an experimental language extension support in the compiler. __tm_retry aborts the current transaction including all the outer transaction enclosing this transaction and retries the transaction starting from the outermost transaction.

Quoting - Ravi Narayanaswamy (Intel)

__tm_retry is provided as an experimental language extension support in the compiler. __tm_retry aborts the current transaction including all the outer transaction enclosing this transaction and retries the transaction starting from the outermost transaction.

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;
}

Quoting - Robert Mullins

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.

Leave a Comment

Please sign in to add a comment. Not a member? Join today