【问题标题】:Use constants with Perl threads在 Perl 线程中使用常量
【发布时间】:2011-06-25 00:49:14
【问题描述】:

threads::shared 不允许在线程之间共享常量。
有没有其他方法可以做到这一点?

【问题讨论】:

    标签: multithreading perl


    【解决方案1】:

    来自perldoc:
    “当在表达式中使用常量时,Perl 会在编译时将其替换为它的值(...)”因此无需在运行时共享它!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-10
      相关资源
      最近更新 更多