Consider a computer and operating system that is available 24 hours/7 days a week (provided no disasters). The physical system that is to be simulated has eight processors that are manage by operating system threads that execute user tasks on behalf of the user (IE. Each processor thread receives a message from the user task to complete the current execution tasks). The operating system has a long-term scheduler that admits user tasks (threads) to the system to then be serviced by two short term schedulers. Each of the two short term schedulers has access to four processors and has an associated shared queue by the four operating system threads that perform the execution (four threads will manage the execution of the user tasks on those simulated processors).
User tasks simulated with a unique thread each enter the system at random times throughout the system lifecycle entering the long term scheduler queue. A user task cannot enter one of the short term scheduler queues if each is filled to capacity (the short term schedulers have a max limit of 15 active tasks). If the there is an open slot in a short term scheduler queue a user task will gain access to a short term scheduler queue and thus compete for processor service with the other tasks in that short term queue. Each user task will enter the system with a specific amount of time slices necessary to complete the user task (each user task will have a random time slice requirement of one to 25 Units).
As soon as a processor thread is free, the user task in that short term scheduler queue that has the shortest remaining time to compete their total units of execution is processed next by a specific processor thread (the user thread must exit the short term scheduler queue and move to the specific processor area to receive the processor thread execution service). A processor thread is either executing a user task or waiting on the next available user task. Each processor thread will have a specific time quantum to provide execution service (processor 1: two units; processor 2: four units; processor 3: three units; and processor 4: two units). In the event that a user’s entire execution requirements have not been completed on the current execution cycle by the processor thread the user thread must reenter the short term scheduler associated with processor thread they just received execution units on. Each of the two short term scheduler queues is organized by the shortest remaining execution time algorithm. When a user’s entire execution requirements are completed, the user task and associated thread leave the system.
Share this recording
Link
Append ?t=30
to start the playback at 30s, ?t=3:20
to start the playback at 3m 20s.
Embed image link
Use snippets below to display a screenshot linking to this recording.
Useful in places where scripts are not allowed (e.g. in a project's README file).
HTML:
Markdown:
Embed the player
If you're embedding on your own page or on a site which permits script tags, you can use the full player widget:
Paste the above script tag where you want the player to be displayed on your page.
See embedding docs for additional options.
Download this recording
You can download this recording in asciicast v2 format, as a .cast file.
DownloadReplay in terminal
You can replay the downloaded recording in your terminal using the
asciinema play
command:
asciinema play 677103.cast
If you don't have asciinema CLI installed then see installation instructions.
Use with stand-alone player on your website
Download asciinema player from
the releases page
(you only need .js
and .css
file), then use it like this:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="asciinema-player.css" />
</head>
<body>
<div id="player"></div>
<script src="asciinema-player.min.js"></script>
<script>
AsciinemaPlayer.create(
'/assets/677103.cast',
document.getElementById('player'),
{ cols: 120, rows: 40 }
);
</script>
</body>
</html>
See asciinema player quick-start guide for full usage instructions.
Generate GIF from this recording
While this site doesn't provide GIF conversion at the moment, you can still do it yourself with the help of asciinema GIF generator utility - agg.
Once you have it installed, generate a GIF with the following command:
agg https://asciinema.org/a/677103 demo.gif
Or, if you already downloaded the recording file:
agg demo.cast demo.gif
Check agg --help
for all available options. You can change font
family and size, select color theme, adjust speed and more.
See agg manual for full usage instructions.