in reply to Re: Splitting one large timeout into few smaller ones..
in thread Splitting one large timeout into few smaller ones..
Do you think there's some simple way of translating this:
into POE? Or would I have to scrap all the code I have written so far and start from the beggining?Event->idle(min=>$mint,max=>$maxt, cb=> [$sth,"method"], max_cb_tm=>$timeout,);
Also, the problem is not exactly with processes being slow, but with multiplying timeouts. Look:
All this code is wrapped in single timeout, iesub vicous { #.... for (0..int(rand(1000))) { sleep(int(rand(10)));# this takes at most 10s }; #... }
Above written as example, not actual code, because as I said, I'm using Event and not the actual alarms, but, what I'm trying to do is:alarm(10000); vicious(); alarm(0);
sub vicious { #... for (0..int(rand(1000))) { sleep(int(rand(10))); #.... alarm(0);#reset alarm, we're OK alarm(10);#reset alarm.. }; #... alarm(10); vicious(); alarm(0);
This theoretically would result in every 'task' operation being kept under 10s.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Splitting one large timeout into few smaller ones..
by tall_man (Parson) on Apr 07, 2005 at 17:15 UTC |