36ee1e2015-10-12Pontus Östlund <!doctype html>
2f26f92015-08-10Henrik Grubbström (Grubba) <html> <head>
36ee1e2015-10-12Pontus Östlund  <meta content="width=device-width, initial-scale=1" name="viewport">
7e5ead2016-01-20Pontus Östlund  <meta charset="utf-8">
2f26f92015-08-10Henrik Grubbström (Grubba)  <title>Pike Reference Manual - ADT.Scheduler</title>
7e5ead2016-01-20Pontus Östlund  <!-- 174 -->
36ee1e2015-10-12Pontus Östlund  <link rel='stylesheet' href='../../../style.css'> <script src='../../../site.js'></script>
2f26f92015-08-10Henrik Grubbström (Grubba)  <style type='text/css'> svg line { stroke:#343434; stroke-width:2; } svg text { fill:#343434; } svg a { fill:#0768b2; text-decoration: underline; } </style> </head>
36ee1e2015-10-12Pontus Östlund  <body>
2f26f92015-08-10Henrik Grubbström (Grubba)  <header>
36ee1e2015-10-12Pontus Östlund  <div class="header"> <div id="version"><strong></strong></div>
7e5ead2016-01-20Pontus Östlund  <div id="burger">&#9776;</div><!-- Hamburger icon --> <h1> <a href="http://pike.lysator.liu.se/"> <span>Pike programming language</span> </a> </h1>
2f26f92015-08-10Henrik Grubbström (Grubba)  </div> </header>
36ee1e2015-10-12Pontus Östlund  <div id="page">
2f26f92015-08-10Henrik Grubbström (Grubba)  <div class="navbar">
36ee1e2015-10-12Pontus Östlund  <nav>
7e5ead2016-01-20Pontus Östlund  <div class="inner" id="navbar">
36ee1e2015-10-12Pontus Östlund  <a href='../../../index.html'><b class='top head'>Top</b></a>
2f26f92015-08-10Henrik Grubbström (Grubba) <a href='../../../ex/predef_3A_3A/ADT.html'><b class='head'>ADT</b></a> <b class='selected head'>ADT.Scheduler</b> <script></script> <noscript> <div class='sidebar'> <a href='../../../ex/predef_3A_3A/ADT/Scheduler/index.html'><b>Symbol index</b></a><br /> </div> </noscript>
36ee1e2015-10-12Pontus Östlund  </div> </nav>
2f26f92015-08-10Henrik Grubbström (Grubba)  </div>
36ee1e2015-10-12Pontus Östlund  <div class="content"> <div class="navbox"> <nav> <div class="sidebar"> <a href="../../../ex/predef_3A_3A/ADT/Queue/cast.html" class="prev"><span>&#10148;</span> ADT.Queue()-&gt;cast()</a> <a href="../../../ex/predef_3A_3A/ADT/Scheduler/Consumer.html" class="next">ADT.Scheduler()-&gt;Consumer <span>&#10148;</span></a> </div> </nav> </div> <div class="contentbox"> <article> <h1>Class ADT.Scheduler</h1>
2f26f92015-08-10Henrik Grubbström (Grubba) <dt class='head--doc'>Inheritance graph</dt>
63130d2015-08-20Henrik Grubbström (Grubba) <div class='inheritance-graph'><svg xmlns='http://www.w3.org/2000/svg' version='1.1' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' width='100%' height='65px'>
2f26f92015-08-10Henrik Grubbström (Grubba) <text x='0' y='20'><a class='ms reference' xlink:href='../../predef_3A_3A/ADT/Heap.html'>ADT.Heap</a></text> <line x1='4' y1='35' x2='35' y2='35' /> <line x1='5' y1='25' x2='5' y2='36' /> <text x='40' y='40'><tspan style='font-family:monospace; font-weight:bold;'>ADT.Scheduler</tspan></text>
63130d2015-08-20Henrik Grubbström (Grubba) <line x1='45' y1='45' x2='45' y2='56' /> <line x1='44' y1='55' x2='75' y2='55' /> <text x='80' y='60'><a class='ms reference' xlink:href='../../predef_3A_3A/ADT/TreeScheduler.html'>ADT.TreeScheduler</a></text>
2f26f92015-08-10Henrik Grubbström (Grubba) </svg></div> <dl class='group--doc'> <dt class='head--doc'>Description</dt> <dd class='body--doc'><p>This class implements a quantized resource scheduler.</p> <p> Weighted consumers are added to the scheduler with <a class='ms reference' href='../../predef_3A_3A/ADT/Scheduler/add.html'>add()</a>, which returns a <a class='ms reference' href='../../predef_3A_3A/ADT/Scheduler/Consumer.html'>Consumer</a> object.</p> <p> When there's some of the resource available to be consumed the resource owner calls <a class='ms reference' href='../../predef_3A_3A/ADT/Scheduler/get.html'>get()</a>, which returns the <a class='ms reference' href='../../predef_3A_3A/ADT/Scheduler/Consumer.html'>Consumer</a> that is to use the resource. <a class='ms reference' href='../../predef_3A_3A/ADT/Scheduler/Consumer/consume.html'>Consumer()-&gt;consume()</a> is then called with the fraction of the quanta that was consumed (typically <code class='expr'>1.0</code>). The amount of resources allocated to a consumer is proportional to the weight of the consumer.</p> <p> A consumer may be temporarily deactivated (in which case it won't be returned by <a class='ms reference' href='../../predef_3A_3A/ADT/Scheduler/get.html'>get()</a>, but still retain its share of the resource which will be provided later by <a class='ms reference' href='../../predef_3A_3A/ADT/Scheduler/get.html'>get()</a> when it has been reactivated.</p> </dd></dl> <hr /> <dl class='group--doc'> <dt class='head--type'><span class='homogen--type'>Inherit</span> <span class='homogen--name'><b>Heap</b></span> </dt> <dd><p><code><span class='datatype'><code class='modifier'>protected</code> inherit </span><a class='ms reference' href='../../predef_3A_3A/ADT/Heap.html'>.Heap</a> : <span class='inherit'>Heap</span></code></p></dd> </dl>
36ee1e2015-10-12Pontus Östlund  </article> </div>
2f26f92015-08-10Henrik Grubbström (Grubba)  </div> </div>
36ee1e2015-10-12Pontus Östlund  <footer> <div id="build-date">Extracted from <strong></strong> as of <strong></strong>.</div> </footer>
7e5ead2016-01-20Pontus Östlund  <script>PikeDoc.current = {"link":"ex/predef_3A_3A/ADT/Scheduler.html","name":"Scheduler"};</script>
2f26f92015-08-10Henrik Grubbström (Grubba) <script src='../../../ex/predef_3A_3A/ADT/index.js'></script> <script src='../../../ex/predef_3A_3A/ADT/Scheduler/load_index.js'></script>
7e5ead2016-01-20Pontus Östlund  <script> // Tell PikeDoc that next actions are from loaded scripts PikeDoc.isInline = false; </script> </body>
2f26f92015-08-10Henrik Grubbström (Grubba) </html>