How to utilize the transactional memory operations?

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.

4 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

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

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.

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

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!