Welcome to Intel® Software Network Quick Login | Join | Help |
Search in Intel® Software Network Forums
in Go

How to utilize the transactional memory operations?

Last post 05-14-2008, 3:04 AM by Jim Cownie. 3 replies.
Sort Posts: Previous Next
 04-06-2008, 8:04 PM 30252234  

How to utilize the transactional memory operations?

I mean the transactional version of malloc, calloc, ralloc and free. And how do I differentiate them with the original memory operations in our programs? Thanks.
 
 04-06-2008, 8:29 PM 30252236 in reply to 30252234  

Re: How to utilize the transactional memory operations?

Any calls to those functions found in transactional context (called directly from __tm_atomic{} block or from function marked as __declspec(tm_callable) which called from transaction) is automatically converted to call to TM-specific implementation, no special actions are required. If by some (very unlikely) reason you want to use non-TM version of malloc/calloc/realloc/free from transaction you should put it inside non-marked routine and use through this routine. In this case usual malloc/realloc/free will be used, but the code will execute serially preserving correctness.

Regards,
Serge Preis

 
 05-13-2008, 8:49 PM 30254769 in reply to 30252236  

Re: How to utilize the transactional memory operations?

Is there any way I can explicitly use the transactional version of malloc/free provided by the compiler? Because I find that the compiler won't automatically apply these functions if I use '-g', even if they are used inside a transaction.
 
 05-14-2008, 3:04 AM 30254789 in reply to 30254769  

Re: How to utilize the transactional memory operations?

Is there any way I can explicitly use the transactional version of malloc/free provided by the compiler? Because I find that the compiler won't automatically apply these functions if I use '-g', even if they are used inside a transaction.

If you use the -fbuiltin (Linux) /Oi (Windows) compile flags along with -g then the compiler will continue to recognise the transactional versions of malloc,free etc.

HTH


Jim Cownie
(Intel Performance, Analysis and Threading Lab)
 
View as RSS news feed in XML

Shortcuts


Tags For This Post

...

Community Tags

...