VEX functions - which are not muti-thread safe?

   4810   1   0
User Avatar
Member
63 posts
Joined: July 2005
Offline
Hello,
I've asked this question in the past at odforce, but since I didn't get any replies, I hoped to get some info here…

Basically my question is: which of the vex functions are safe for multi-threading, and which are not? E.g. - I remember having issues with the pcunshaded() function (this is in mentioned in the documentation). Is pciterate safe? In other words, I am asking which vex functions will give wrong results, not whether the algorithms they use internally employs multiple threads…

In any case, I think this info will be useful to many users, and save us the hassle of manually checking vex ops for threading-correctness.

Cheers
User Avatar
Member
1002 posts
Joined: July 2005
Offline
All VEX functions should be multithread-safe, at least they should not cause the program to crash at runtime. If you do receive a crash when using a certain VEX function, please submit a bug for it.

Although the functions are thread-safe, it's possible that some functions may behave differently depending on what order they are called. When multithreading is used in mantra, it's likely that different renders of the same image will render the tiles in different order, resulting in a different sequence of function calls. In the case of pcunshaded, the set of points being iterated may change depending on what point gets shaded first. In this case, you just need to be careful that your shader is order-independent - that is, it will produce the same result no matter what order the points are shaded.

Andrew
  • Quick Links