|
开gh 08.X版的时候总是发现CPU跑不满 计算速度无比蛋疼有木有
http://www.nzarchitecture.com/blog/index.php/2011/05/07/threading-grasshopper/
摘几段原文
Finally, since the threads are executing co-currently to the main thread, we have to pause the main thread until the other threads have finished processing before returning the data from the node. For simplicity sake I have used a really naive method of waiting, which loops until the right number of tasks are done.
While multi-threading offers significant speed improvements, it is not without downsides. It can be challenging and frustrating to debug threaded code since interactions between threads can throw unforeseen errors from bugs that are invisible in the Grasshopper IDE. These errors will often crash Rhino: save frequently. Furthermore, not all functions in Rhino 4 are thread safe. So if you use the unsafe function of plane-brep intersection in different threads, you will either crash Rhino or end up with strange results. Rhino 5 addresses some of the thread safety issues and once it moves to .Net4.0 there will be access to even easier threading functions.
大意为gh线程分配不是太好导致计算缓慢 这主要是犀牛SDK的一些类自身的不完善
我想 虽然大家可以在代码中控制线程 不过那样的活做下来 设计思路早就没了 建议有经验的人来交流下线程控制经验 |
|