36ee1e | 2015-10-12 | Pontus Östlund | | <!doctype html>
|
2f26f9 | 2015-08-10 | Henrik Grubbström (Grubba) | | <html>
<head>
|
36ee1e | 2015-10-12 | Pontus Östlund | | <meta content="width=device-width, initial-scale=1" name="viewport">
|
7e5ead | 2016-01-20 | Pontus Östlund | | <meta charset="utf-8">
|
2f26f9 | 2015-08-10 | Henrik Grubbström (Grubba) | | <title>Pike Reference Manual - ADT.Scheduler</title>
|
0e3f09 | 2016-04-19 | Henrik Grubbström (Grubba) | | |
36ee1e | 2015-10-12 | Pontus Östlund | | <link rel='stylesheet' href='../../../style.css'>
<script src='../../../site.js'></script>
|
0e3f09 | 2016-04-19 | Henrik Grubbström (Grubba) | | $version_js$
$date_js$
|
2f26f9 | 2015-08-10 | Henrik 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>
|
36ee1e | 2015-10-12 | Pontus Östlund | | <body>
|
2f26f9 | 2015-08-10 | Henrik Grubbström (Grubba) | | <header>
|
36ee1e | 2015-10-12 | Pontus Östlund | | <div class="header">
|
0e3f09 | 2016-04-19 | Henrik Grubbström (Grubba) | | <div id="version"><strong data-id="version"></strong></div>
|
7e5ead | 2016-01-20 | Pontus Östlund | | <div id="burger">☰</div> |
0e3f09 | 2016-04-19 | Henrik Grubbström (Grubba) | | <a href="http://pike.lysator.liu.se/" class="logo">
|
7e5ead | 2016-01-20 | Pontus Östlund | | <span>Pike programming language</span>
</a>
</h1>
|
2f26f9 | 2015-08-10 | Henrik Grubbström (Grubba) | | </div>
</header>
|
36ee1e | 2015-10-12 | Pontus Östlund | | <div id="page">
|
2f26f9 | 2015-08-10 | Henrik Grubbström (Grubba) | | <div class="navbar">
|
36ee1e | 2015-10-12 | Pontus Östlund | | <nav>
|
7e5ead | 2016-01-20 | Pontus Östlund | | <div class="inner" id="navbar">
|
36ee1e | 2015-10-12 | Pontus Östlund | | <a href='../../../index.html'><b class='top head'>Top</b></a>
|
2f26f9 | 2015-08-10 | Henrik 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>
|
36ee1e | 2015-10-12 | Pontus Östlund | | </div>
</nav>
|
2f26f9 | 2015-08-10 | Henrik Grubbström (Grubba) | | </div>
|
36ee1e | 2015-10-12 | Pontus Östlund | | <div class="content">
<div class="navbox">
<nav>
<div class="sidebar">
<a href="../../../ex/predef_3A_3A/ADT/Queue/cast.html" class="prev"><span>➤</span> ADT.Queue()->cast()</a>
<a href="../../../ex/predef_3A_3A/ADT/Scheduler/Consumer.html" class="next">ADT.Scheduler()->Consumer <span>➤</span></a>
</div>
</nav>
</div>
<div class="contentbox">
<article>
<h1>Class ADT.Scheduler</h1>
|
2f26f9 | 2015-08-10 | Henrik Grubbström (Grubba) | | <dt class='head--doc'>Inheritance graph</dt>
|
63130d | 2015-08-20 | Henrik 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'>
|
2f26f9 | 2015-08-10 | Henrik 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>
|
63130d | 2015-08-20 | Henrik 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>
|
2f26f9 | 2015-08-10 | Henrik 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()->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>
|
36ee1e | 2015-10-12 | Pontus Östlund | | </article>
</div>
|
2f26f9 | 2015-08-10 | Henrik Grubbström (Grubba) | | </div>
</div>
|
36ee1e | 2015-10-12 | Pontus Östlund | | <footer>
|
0e3f09 | 2016-04-19 | Henrik Grubbström (Grubba) | | <div id="build-date">Extracted from <strong data-id="version"></strong> as of <strong data-id="date"></strong>.</div>
|
36ee1e | 2015-10-12 | Pontus Östlund | | </footer>
|
7e5ead | 2016-01-20 | Pontus Östlund | | <script>PikeDoc.current = {"link":"ex/predef_3A_3A/ADT/Scheduler.html","name":"Scheduler"};</script>
|
2f26f9 | 2015-08-10 | Henrik 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>
|
7e5ead | 2016-01-20 | Pontus Östlund | | <script>
// Tell PikeDoc that next actions are from loaded scripts
PikeDoc.isInline = false;
</script>
</body>
|
2f26f9 | 2015-08-10 | Henrik Grubbström (Grubba) | | </html>
|