NCF参数化建筑论坛

标题: GH多线程(老生常谈的问题) [打印本页]

作者: panhao1    时间: 2011-9-12 02:00
标题: GH多线程(老生常谈的问题)
开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的一些类自身的不完善

我想 虽然大家可以在代码中控制线程 不过那样的活做下来 设计思路早就没了 建议有经验的人来交流下线程控制经验
作者: ninesuns    时间: 2011-9-12 09:46
计算机也是硬伤。。。
作者: forest19901211    时间: 2011-9-12 21:21
{:3_46:} {:3_47:}
作者: skywoolf    时间: 2011-9-12 23:32
设计思路和编辑数模的思路确实需要一个很好节奏来交替攀升。感觉这种思路的交织可能会让很多人头疼吧
作者: ptptpth    时间: 2011-9-13 21:05
谢谢楼主,楼主辛苦了
作者: lkuan6239    时间: 2011-10-22 03:49
gh线程分配的确不好,能不能改善?
作者: sunna007    时间: 2012-2-21 17:02
我{:3_46:}不动
作者: MACH    时间: 2012-6-8 23:45
解決思路一派是+,另一派是-。




欢迎光临 NCF参数化建筑论坛 (http://bbs.ncf-china.com/) Powered by Discuz! X3.2