找回密码
 注册
搜索
查看: 15602|回复: 7

[已回复] GH多线程(老生常谈的问题)

[复制链接]
发表于 2011-9-12 02:00:58 | 显示全部楼层 |阅读模式
开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的一些类自身的不完善

我想 虽然大家可以在代码中控制线程 不过那样的活做下来 设计思路早就没了 建议有经验的人来交流下线程控制经验
发表于 2011-9-12 09:46:12 | 显示全部楼层
计算机也是硬伤。。。
回复

使用道具 举报

发表于 2011-9-12 21:21:55 | 显示全部楼层
{:3_46:} {:3_47:}
回复

使用道具 举报

发表于 2011-9-12 23:32:50 | 显示全部楼层
设计思路和编辑数模的思路确实需要一个很好节奏来交替攀升。感觉这种思路的交织可能会让很多人头疼吧
回复

使用道具 举报

发表于 2011-9-13 21:05:15 | 显示全部楼层
谢谢楼主,楼主辛苦了
回复

使用道具 举报

发表于 2011-10-22 03:49:37 | 显示全部楼层
gh线程分配的确不好,能不能改善?
回复

使用道具 举报

发表于 2012-2-21 17:02:05 | 显示全部楼层
我{:3_46:}不动
回复

使用道具 举报

发表于 2012-6-8 23:45:55 | 显示全部楼层
解決思路一派是+,另一派是-。
回复

使用道具 举报

NCFZ微信公众号

手机版|小黑屋|NCF参数化建筑论坛 ( 浙ICP备2020044100号-2 ) 辽公网安备21021102000973号

GMT+8, 2026-11-23 21:38 , Processed in 0.046797 second(s), 19 queries , Gzip On.

Powered by Discuz! X5.0 Licensed

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表