西西河

主题:【求助】:请教信息技术方面的大牛有关多线程的问题 -- newtime

共:💬51 🌺45
分页树展主题 · 全看首页 上页
/ 4
下页 末页
            • 家园 那是很热门也实用的。。。

              只是觉得现在经济学研究里的哲学成分少了些。。。不过现在的主流哲学本身的智慧成分就很少。。。西方哲学家的兴趣是在如何把哲学科学化。。。如有兴趣,我们或许可以探讨一下经济学里的哲学。。。:)

              关键词(Tags): #经济学#哲学
    • 家园 在同一个CPU上,同样的总计算量的话,

      多线程因为有额外的工作要做来产生和管理线程,当然需要花更多的时间。。。除非你写一个程序可以同时利用多个CPU来产生多线程,那么因为多个CPU同时进行计算,时间就可以短了。。。。

      关键词(Tags): #CPU#多线程
    • 家园 And also it's Monte Carlo

      not Mont Carlo, but that's for sure just a typo.

    • 家园 Computer Science 101

      A light weight process, ie, the thread, must do substantial chunk of work to gain sufficient efficiency. In your case, I highly suspect it's because the threads are not doing enough work, so your CPU spends most of the time creating and destroying the threads instead of doing calculation, the real work.

      • 家园 good point
        • 家园 FORTAN 不懂。两个thread 里面有没使用需要

          同步的库函数,可能一些库函数,在实现时,会共享变量,而这些变量需要线程同步。还有多线程,不等于多CPU。跟你的系统有关.

分页树展主题 · 全看首页 上页
/ 4
下页 末页


有趣有益,互惠互利;开阔视野,博采众长。
虚拟的网络,真实的人。天南地北客,相逢皆朋友

Copyright © cchere 西西河