Havok Multithreaded Memory Allocation

Havok Multithreaded Memory Allocation

Hi all,

I was wondering if it's possible to perform Havok memory allocations (e.g.hkMemTempBufAlloc) from multiple threads at once? In my limited testing, this doesn't seem to be the case, but the header file mentions thread-local stack allocations for some of the calls, so maybe I'm just doing it wrong? Any guidance would be appreciated.

2 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

Short answer: yes. Each thread has it's own hkMemoryRouter, which owns a collection of allocators. So allocations from different threads should not stall. The exception here is if the threads run out of memory and need to go back to the user memory allocation function, which is likely to lock.

What's your test case? What seems to be going wrong?


Kommentar hinterlassen

Bitte anmelden, um einen Kommentar hinzuzufügen. Sie sind noch nicht Mitglied? Jetzt teilnehmen