About Store Forum Documentation Contact



Post Reply 
Is PathObstacle.create() Thread Safe?
Author Message
fatcoder Offline
Member

Post: #1
Is PathObstacle.create() Thread Safe?
I'm using MultiThreadedCall() to run a method that needs to create a lot of PathObstacles. However, sometimes it will crash (with an access violation) on the call to create() for some random PathObstacle. It seems to be completely random, i.e. it works fine most of the time, So I'm guessing one thread is trying to create a PathObstacle on a PathWorld at the same time as another thread.

If I create all the PathObstacles without using MultiThreadedCall(), then I don't seem to run into the problem. It just a lot slower.

If it isn't thread safe, any chance of making it thread safe? I know I can use CritSect, but was hoping it could be thread safe by default in EE.
02-15-2013 09:27 AM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #2
RE: Is PathObstacle.create() Thread Safe?
Thanks for the reply, but unfortunately this has nothing to do with PhysX. I'm talking about the recast nav mesh obstacles.
02-16-2013 01:22 AM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #3
RE: Is PathObstacle.create() Thread Safe?
I'll wait to hear from Esenthel before pursuing that.
02-16-2013 02:03 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Is PathObstacle.create() Thread Safe?
This func is not multi threaded safe
It should be called only on main thread
Multi threaded improvement of that func is on the roadmap
02-19-2013 11:23 AM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #5
RE: Is PathObstacle.create() Thread Safe?
OK, thanks. It will be a major help. At the moment, creating obstacles in a multi threaded environment is a real hit and miss thing. Sometimes, they create, sometimes they don't other times you just get access violations. Looking forward to it.
02-26-2013 02:10 AM
Find all posts by this user Quote this message in a reply
Post Reply