threads

Queueの管理で並列ダウンロード

3スレッドでダウンロードを並列して行いたい。スレッドのキューを使って解決できた use strict; use warnings; use threads; use threads::shared; use Thread::Queue; use LWP::UserAgent; # ダウンロードキューを生成する my @download_list = ( "http://e…

use threads; するときに注意すべきこと の続編

[Perl][threads] use threads; するときに注意すべきこと http://d.hatena.ne.jp/punitan/20091018/1255892339これの続編なぜスレッド処理をするとインタプリタが落ちるのか原因がわかった。 Thread safety use encoding ... is not thread-safe (i.e., do n…

use threads; するときに注意すべきこと

use threads; で1日嵌った。 環境は Active Perl - v5.10.1 built for MSWin32-x86-multi-threadthreadsを使う時、標準出力のエンコードをbinmodeで指定しておくとインタプリタが落ちる。なので、 my $cp932 = find_encoding('cp932'); print $cp932->encode…