You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/10/08 11:52:32 UTC

[GitHub] marcoabreu commented on issue #12756: Is NDArray creatiton thread safe

marcoabreu commented on issue #12756: Is NDArray creatiton thread safe
URL: https://github.com/apache/incubator-mxnet/issues/12756#issuecomment-427805168
 
 
   Hello,
   In general, mxnet is not threadsafe. It goes as far as not even being safe to be called using a mutex.
   
   Any interaction with mxnet has to happen with the same sticky thread in a single threaded fashion. Speak, if you use thread 1000 the first time you interact with mxnet, you always have to use thread 1000. This is called a dispatcher pattern.
   
   Many people like to synchronize threads by using a mutex, like thread 1000, 1001, 1002 etc. This will not work because we have thread local variables that won't be present if you call with different threads.
   
   Thus, you should create a dedicated thread for any interaction with mxnet and pipe your commands through that thread.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services