Chinaunix首页 | 论坛 | 博客
  • 博客访问: 13765
  • 博文数量: 3
  • 博客积分: 377
  • 博客等级: 二等列兵
  • 技术积分: 40
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-06 15:52
文章分类

全部博文(3)

文章存档

2010年(3)

分类:

2010-08-23 15:09:16

好像不怎么好用呢。。。。
阅读(1703) | 评论(6) | 转发(0) |
0

上一篇:今天天气还好

下一篇:perl, rand

给主人留下些什么吧!~~

cups_book2010-08-23 16:15:59

my $size = $thr->get_stack_size();
    print $size;

cups_book2010-08-23 16:09:27

异步线程,失败:
my @files = ('H23B');
my $thr2 = async { foreach (@files) { ... } };
   
$thr2->join();

if (my $err = $thr2->error()) {
        warn("Thread error: $err\n");
    }
-----------------------------------
Thread error: Unimplemented at D:\perl_test\QU\ba.pl line 40.

cups_book2010-08-23 16:04:27

use threads ('yield',
                 'stack_size' => 64*4096,
                 'exit' => 'threads_only',
                 'stringify');
上面的例子中用这个use 也可以。

cups_book2010-08-23 16:02:43

use threads;
use threads::shared;

sub start_thread {
        my @args = @_;
        print('Thread started: ', join(' ', @args), "\n");
    }
    my $thr = threads->create('start_thread', 'argument');
    $thr->join();