You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now noticed there is already an issue for this #12
I ran into a memory error with the PMacc-GoL in a multithreaded case with resource manager.
After an investigation i found that in cuplaMallocHost(), the variable buf is a nullptr, which comes from manager::Memory::alloc(), which makes a reference out of an pointer (read from a map).
The variable manager::Memory::m_mapVector is not protected with a mutex, so there is a race condition indeed when doing multiple cuplaMallocHost() concurrently, causing one insert to be overwritten.
Could be solved with a simple mutex.
@psychocoderHPC@ax3l do you think we should add a note to the readme (or somewhere) that cupla API is not thread safe, as was correctly pointed out in this issue?
Yes, should be documented in the docs, including a few words what this implies/how to use it. (Just noting it might be too brief for non-computer scientists.)
Now noticed there is already an issue for this #12
I ran into a memory error with the PMacc-GoL in a multithreaded case with resource manager.
After an investigation i found that in
cuplaMallocHost()
, the variablebuf
is a nullptr, which comes frommanager::Memory::alloc()
, which makes a reference out of an pointer (read from a map).The variable
manager::Memory::m_mapVector
is not protected with a mutex, so there is a race condition indeed when doing multiplecuplaMallocHost()
concurrently, causing oneinsert
to be overwritten.Could be solved with a simple mutex.
In
cuplaMallocHost()
:So here is the relevant backtrace from my case:
The text was updated successfully, but these errors were encountered: