… | |
… | |
34 | use Storable (); |
34 | use Storable (); |
35 | |
35 | |
36 | use Coro (); |
36 | use Coro (); |
37 | use Coro::State; |
37 | use Coro::State; |
38 | use Coro::Handle; |
38 | use Coro::Handle; |
39 | use Coro::EV; |
39 | use Coro::AnyEvent; |
40 | use Coro::Timer; |
40 | use Coro::Timer; |
41 | use Coro::Signal; |
41 | use Coro::Signal; |
42 | use Coro::Semaphore; |
42 | use Coro::Semaphore; |
43 | use Coro::AnyEvent; |
43 | use Coro::AnyEvent; |
44 | use Coro::AIO; |
44 | use Coro::AIO; |
… | |
… | |
56 | use Time::HiRes; |
56 | use Time::HiRes; |
57 | use Compress::LZF; |
57 | use Compress::LZF; |
58 | use Digest::MD5 (); |
58 | use Digest::MD5 (); |
59 | |
59 | |
60 | AnyEvent::detect; |
60 | AnyEvent::detect; |
|
|
61 | |
|
|
62 | IO::AIO::max_poll_reqs 1;#d# |
61 | |
63 | |
62 | # configure various modules to our taste |
64 | # configure various modules to our taste |
63 | # |
65 | # |
64 | $Storable::canonical = 1; # reduce rsync transfers |
66 | $Storable::canonical = 1; # reduce rsync transfers |
65 | Coro::State::cctx_stacksize 256000; # 1-2MB stack, for deep recursions in maze generator |
67 | Coro::State::cctx_stacksize 256000; # 1-2MB stack, for deep recursions in maze generator |
… | |
… | |
3437 | reload_config; |
3439 | reload_config; |
3438 | db_init; |
3440 | db_init; |
3439 | load_extensions; |
3441 | load_extensions; |
3440 | |
3442 | |
3441 | $Coro::current->prio (Coro::PRIO_MAX); # give the main loop max. priority |
3443 | $Coro::current->prio (Coro::PRIO_MAX); # give the main loop max. priority |
3442 | evthread_start IO::AIO::poll_fileno; |
|
|
3443 | } |
3444 | } |
3444 | |
3445 | |
3445 | EV::loop; |
3446 | EV::loop; |
3446 | } |
3447 | } |
3447 | |
3448 | |
… | |
… | |
3829 | { |
3830 | { |
3830 | # configure IO::AIO |
3831 | # configure IO::AIO |
3831 | |
3832 | |
3832 | IO::AIO::min_parallel 8; |
3833 | IO::AIO::min_parallel 8; |
3833 | IO::AIO::max_poll_time $TICK * 0.1; |
3834 | IO::AIO::max_poll_time $TICK * 0.1; |
3834 | $AnyEvent::AIO::WATCHER->priority (1); |
3835 | #undef $AnyEvent::AIO::WATCHER; |
3835 | } |
3836 | } |
3836 | |
3837 | |
3837 | my $_log_backtrace; |
3838 | my $_log_backtrace; |
3838 | |
3839 | |
3839 | sub _log_backtrace { |
3840 | sub _log_backtrace { |
… | |
… | |
3877 | # load additional modules |
3878 | # load additional modules |
3878 | use cf::pod; |
3879 | use cf::pod; |
3879 | |
3880 | |
3880 | END { cf::emergency_save } |
3881 | END { cf::emergency_save } |
3881 | |
3882 | |
|
|
3883 | evthread_start IO::AIO::poll_fileno; |
|
|
3884 | |
3882 | 1 |
3885 | 1 |
3883 | |
3886 | |