Coro は first class の co-routine を実装しようとおもって開発してたら、「あれ、これ co-operative thread にできるのでは?」とおもいはじめたわけなのであり、そうしてみたということなのであった。 Coro は co-operative thread なわけであるが、以下のようにすると、時間ごとにスレッドをスイッチできるわけなのであり。一定時間ごとに cede; してるということなのである。CPU インテンシブな処理の最中で cede 書くのが面倒な場合にはこれが有用なのだろうとおもうのである(see Coro.pm)。 # "timeslice" the given block sub timeslice(&) { use Time::HiRes (); Coro::on_enter { # on entering the thread, we