hi, how I can make priority scheduler on perl? e.g. I've data flow and need queueing this by different priorites(timeouts), i.e. if something was matched it must be inherent on specify timer issue, but timer can be flushed if happening external influence(while log-file reading would be read a new value related with this timer queue)
my $priority;
again:
$priority->{$thing}->{$index}->{timer} = $timer; # $time are external
+value
#and then check this out...
if($priority->{$thing}->{$index}->{timer} < 1000){
#enqueued by wait and then again check accepted new external value
$priority->{$thing}->{$index}->{wait} = $priority->{$thing}->{$index}-
+>{wait} + 100;
...
goto again; # how this make not blocked?
}else{
do_smth();
}
in another words I need wait if some timer of those $thing and $index until 1000 and do than non-blocked, because if I would do this by blocked way it must be ugly and idea with queues brought a fiasco.
in conclude my aim is to do queuing matched patterns coming from flow of the data in one thread.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.