Skip to content

lasttruffulaseed/general-cs-fun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

general-cs-fun

Fun projects in the art and science of computing
patrick.haren@yahoo.com

MemPagerSim


The textbook Operating System Concepts, 8th edition by Silberschatz, Galvin and Gagne, describes various strategies for page replacement in virtual memory systems.
This c# app implements a trivial framework and UI for simulating such strategies. It includes examples for FIFO, Optimal and LRU page replacement algorithms. The app takes a sequence string, similar to the strings described in the text, that describe the algorithm to use, the simulated number of frames and the sequence of page requests to be simulated.

Fun Features!

1) An extensible class framework to allow additional algorithms to be plugged in.
2) Use of abstract methods/callbacks for the extension points.
3) Use of an embedded browser control for 'pretty printing' of the simulation. This is a similar implementation pattern to what is used within multi-platform mobile applications - whereby the rendering leverages existing capabilities of a native browser.
See slides 9.25 to 9.31, in ch9_1.pdf, for a description of the FIFO and Optimal page replacement strategies. The Optimal strategy requires an advanced "crystal ball processor unit", with properties similar to a flux capacitor. We're simulating its immense capabilities here by providing the request sequence in advance to the algorithm... Also, slides 9.4 to 9.8, in ch9_2.pdf, describe the LRU page replacement strategy. The 'pretty printed' output is formatted to look the same as in the examples in the text - with the sequence of frames moving horizontally across the page.
Perhaps the app could be used to produce more examples in later additions of the text... ;)

Monopoly-Simulator



This is a c++ console app (on purpose), which includes the rules for the game of monopoly, for simulating random games.
It was an exercise to flex the use of multiple-inheritence, polymorphism and dynamic dispatches of many types.

About

Fun projects in the art and science of computing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published