NCF参数化建筑论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 10878|回复: 7
打印 上一主题 下一主题

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

[复制链接]
跳转到指定楼层
1m
发表于 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的一些类自身的不完善

我想 虽然大家可以在代码中控制线程 不过那样的活做下来 设计思路早就没了 建议有经验的人来交流下线程控制经验
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享
2m
发表于 2011-9-12 09:46:12 | 只看该作者
计算机也是硬伤。。。
3m
发表于 2011-9-12 21:21:55 | 只看该作者
{:3_46:} {:3_47:}
4m
发表于 2011-9-12 23:32:50 | 只看该作者
设计思路和编辑数模的思路确实需要一个很好节奏来交替攀升。感觉这种思路的交织可能会让很多人头疼吧
5m
发表于 2011-9-13 21:05:15 | 只看该作者
谢谢楼主,楼主辛苦了
6m
发表于 2011-10-22 03:49:37 | 只看该作者
gh线程分配的确不好,能不能改善?
7m
发表于 2012-2-21 17:02:05 | 只看该作者
我{:3_46:}不动
8m
发表于 2012-6-8 23:45:55 | 只看该作者
解決思路一派是+,另一派是-。

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

GMT+8, 2024-12-18 20:45 , Processed in 0.100188 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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