hoknamahn Posted July 22, 2007 Share Posted July 22, 2007 I wonder is there standard interface (in API) for development of multithreaded operators? I know people did it in their software (say multithreaded SOP's in 5x5) but is it more like hack or a legal way? Should you fork processes using system calls or use some HDK functions? Quote Link to comment Share on other sites More sharing options...
Jason Posted July 23, 2007 Share Posted July 23, 2007 I've never used this myself but I've read responses from SESI developers on this topic where they mention the UT_Thread and pthread classes in the HDK. Here is a link: http://odforce.net/hdk/tree/H8.0/toolkit/h...UT__Thread.html Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted July 23, 2007 Author Share Posted July 23, 2007 Thanks Jason! Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted October 20, 2007 Author Share Posted October 20, 2007 (edited) What if several threads try to write a data in GDP should you do something special like some sort of synchronization or locking? Edited October 20, 2007 by hoknamahn Quote Link to comment Share on other sites More sharing options...
edward Posted October 20, 2007 Share Posted October 20, 2007 Yes. Quote Link to comment Share on other sites More sharing options...
Jason Posted October 21, 2007 Share Posted October 21, 2007 Yes. I can imagine that modifications to the positions of points and values of (non-string) attributes would be far more forgiving than changes to to the topology or vertex count of the gdp, right? Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted October 21, 2007 Author Share Posted October 21, 2007 I agree should be big difference between modifying of topology or modifying of attributes in general. But can be no difference for HDK... What do you think Edward? Another question is how to write into GDP using multiple threads? An easiest solution for me is to divide existing geometry into several pieces (i.e. create new GDPs) and each thread will modify it's own independent piece. Then merge those GDPs into one piece using just one thread. But is it good idea? Quote Link to comment Share on other sites More sharing options...
edward Posted October 22, 2007 Share Posted October 22, 2007 There's no magic bullet here. The data structures in GEO_Detail aren't thread-safe. Without intrinsic knowledge of what GEO_Detail does, the best policy is to use locks before writing into the same gdp. Once you have all the GEO_Point and GEO_Primitive objects created, one can conceivably write into different objects from different threads. However, do so at your own discretion because I've warned you. I can imagine that modifications to the positions of points and values of (non-string) attributes would be far more forgiving than changes to to the topology or vertex count of the gdp, right? I don't see how that matters. If two threads write into the same point's x position, that's bad news whichever way you cut it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.