How to utilize the transactional memory operations?

How to utilize the transactional memory operations?

Аватар пользователя jiaq

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.

4 posts / 0 новое
Последнее сообщение
Пожалуйста, обратитесь к странице Уведомление об оптимизации для более подробной информации относительно производительности и оптимизации в программных продуктах компании Intel.
Аватар пользователя Serge Preis (Intel)

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 transactionyou 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

Аватар пользователя jiaq

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.

Аватар пользователя James Cownie (Intel)

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

Зарегистрируйтесь, чтобы оставить комментарий.