EXPERIMENT 1

 

This first experiment was run with the ìbusy waitî technique that we discussed (see CPU currentcy column).Ý Also, the resource containers received a huge influx of currentcy when the process began, causing disk spinup to occur immediately.Ý It was run three times, with three simultaneous processes (the same actual program) running at the same time.Ý With the idea of ensuring that disk spinup would occur by the third processí read request, they were given the respective priorities of 4, 5, and 6 on each run.Ý The read activity in each program was staggered ñ in the first process, it was activated immediately, the second process waited 5 sec, and the third process waited 10 sec.Ý The delay time between file reads in all three programs was 10 sec ñ not enough for the disk to spindown (total delay in each program was 30 sec).Ý The power allocation was 12000 mW.Ý Each program read in three files from disk, storing data on the time (including read time and 10 sec ìthink timesî) required to complete, the amount of currentcy used on the hard drive and the cpu, the total currentcy allocated to the resource container, and the residual currentcy in the container when the process ended.Ý This is where I am not totally sure if the statistics are accurate.Ý In situations where the HD currentcy spent is 0, it means the files were accidentally already in memory.

 

PID

Priority

Seconds

Microseconds

HD Currentcy

CPU Currentcy

Total allocation

Residual Currentcy

826

4

31

423935

2127444

15271457

14700000

7803854

855

4

31

339194

2267834

15533966

17300000

10001120

886

4

30

669354

2528378

14735931

14400000

7638446

827

5

30

319870

1622476

16005489

15100000

7974955

856

5

31

257410

1675641

16384136

17700000

10143308

887

5

30

349498

0

16803654

14400000

7596346

828

6

32

316225

1634887

17580285

15200000

6487748

857

6

31

359522

1584950

17367959

17800000

9350011

888

6

33

303738

2076900

17665827

14600000

5360358

 

AVG

31

370971.7778

1724278.889

16372078.22

15688888.89

8039571.778

 

MAX

33

669354

2528378

17665827

17800000

10143308

 

MIN

30

257410

0

14735931

14400000

5360358

 

EXPERIMENT 2

 

In this second experiment, I eliminated the ìbusy waitî problem by using the sleep() system call.Ý This allowed more currentcy to become available for use in accessing the hard drive.Ý I also reset the amount of currentcy in the resource container to 0 after the process started, neutralizing the effects of the initial allocation of currentcy upon creation of the processí resource container.Ý This experiment was run 5 times, using respective priorities of 7, 8, and 9 for the three programs on each run.Ý The delay time between read requests was 60 seconds, allowing the hard drive to spindown after each set of requests (total delay of 180 sec for each program).Ý Since less currentcy was used by the CPU, the power allocation could be reduced to 3000 mW while still being sufficient to spinup the hard drive when two or three bids were added.Ý Once again, in situations where the amount of currentcy spent on the hard drive is 0, the files were accidentally stored in memory.Ý Oops!

 

PID

Priority

Seconds

Microseconds

HD Currentcy

CPU Currentcy

Total allocation

Residual Currentcy

837

7

192

425809

3110760

742867

21600000

16684534

924

7

181

432843

3323321

497494

20100000

15112385

951

7

180

152426

0

288081

19550000

18496933

982

7

180

170757

0

362912

20500000

18195792

1011

7

195

817041

3985701

1076602

21850000

15980855

839

8

189

724113

3219183

973809

20700000

16373775

926

8

189

333566

3742521

592202

21150000

16728595

952

8

190

63577

4540282

852344

21650000

16366854

983

8

188

293571

4414594

1020843

21550000

15905235

1012

8

187

559976

1053966

585539

21100000

18843660

838

9

183

484151

3158726

718952

21000000

16862910

925

9

182

793767

3696049

779209

21450000

16961720

953

9

183

623565

4464403

586952

21500000

16402913

984

9

181

959981

4406392

676489

21250000

16147328

1013

9

182

699979

4105396

521788

20650000

16264300

 

AVG

185.4667

502341.4667

3148086.267

685072.2

21040000

16755185.93

 

MAX

195

959981

4540282

1076602

21850000

18843660

 

MIN

180

63577

0

288081

19550000

15112385