-
Notifications
You must be signed in to change notification settings - Fork 0
emontoya/soa_p1
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is the first programming task for course Advanced Operating Systems. Authors: -Ediber Montoya Moreira -Leandro Cordero The specification could be found in file Proyecto1.pdf. Steps to build the project for the first time: 1- Execute ./autogen.sh script 2- Execute ./configure 3- Execute ./make You have additional make options: - make clean: Remove any generated file - make install: Install the executable - make uninstall: Uninstall de executable Note: install and uninstall must be run as root (sudo make ...) This application reads the configuration from file "config.txt" that should be located in the executable directory. The first line in this file should contain two integer values: The first, is the value indicating whether we use preemptive schedulling or not, and the second one is the time slice for each process to run or the work factor to perform for each thread before releasing the processor. The subsequent lines in the file represents threads configuration. In this lines, the first value indicates de tickets assigned to this thread and the second is the total work to perform for this thread. Here is a config file example: config.txt 1 150 50 20 10 50 32 25 100 50 50 20 In this case we use a preemptive schedulling with a quantum of 150 ms. Calculations: ------------- For calculating 2 arccos(0) we use that arccos(x) = (PI/2) - arcsin(x) for x = 0. So 2 arccos(0) = 2 * (PI/2) = PI; In order to aproximate PI we use that arctan(1) = PI/4 so: PI = 4 * arctan(1). arctan(1) = 1 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11 ... + (((-1)^n)/(2n + 1)) see: http://www.intmath.com/series-expansion/2-maclaurin-series.php http://en.wikipedia.org/wiki/Leibniz_formula_for_pi This approach is known for its slow convergence but it serves the purpose in this exercise
About
First programming task for the course: Advanced Operating Systems
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published