Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
11 Views

TSX RTM Related Question

Hello, everyone, I just start to learn RTM programming.

I have some questions about RTM. Take the following code for example(from: http://lwn.net/Articles/533894/), if the lock is not free, then it will execute _xabort, and return abort state 0xff. Will the program go back to execute _xbegin again, and found the _xbegin is no equal to _XBEGIN_STARTED, then it will execute fallback handler. Is my understanding right?

if ((status = _xbegin()) == _XBEGIN_STARTED){	/* Start transaction */
	    if (lock is free)	/* Check lock and put into read-set */
		return;		/* Execute lock region in transaction */
	
	    _xabort(0xff);		/* Abort transaction as lock is busy */
}else{				
	/* fallback handler */
}

Also, I saw two RTM Abort Status Definition in Intel® 64 and IA-32 Architectures Optimization Reference Manual(Table 12-1. RTM Abort Status Definition) and Intel® 64 and IA-32 Architectures Software Developer’s Manual(Table 15-1. RTM Abort Status Definition). It seems that they are different, but I did not quite understand.

I know if the lock is not free, we should set abort status to 0xff. Is that any other situation that abort status will be automatically set to 0xff? How could we distinguish TM region is abort because of lock is not free and other events that cause automatically abort? Also, I found the status return value could be 0 and 8. Is there any different there?

Thanks a lot in advance! 

 

 

 

 

 

 

Tags (1)
0 Kudos
1 Reply
Highlighted
Black Belt
11 Views

Questions on these topics seem more likely to get answers on the ISA forum

https://software.intel.com/en-us/forums/intel-isa-extensions

There is also a collection of references

https://software.intel.com/en-us/blogs/2013/06/07/web-resources-about-intelr-transactional-synchroni...

0 Kudos