-
operating system program in java
1. A process contains eight virtual pages on disk and is assigned a fixed
allocation of
four page frames in main memory. The following page trace occurs:
1, 0, 2, 2, 1, 7, 6, 0, 1, 2, 0, 3, 0, 4, 5, 1, 5, 2, 4, 5, 6, 7, 2, 4, 2,
7, 3, 3, 2, 3
a. Show the successive pages residing in the four frames using the LRU
replacement algorithm. Compute the hit ratio in main memory. Assume the
frames are initially empty.
b. Repeat part (a) for the FIFO replacement policy.
c. Explain why the differences between the two ratios in part (a) and part
(b).
d. Write a program (e.g. using Java) to simulate part (a) and part (b). That
is, to
simulate that a fixed allocation of four page frames in main memory is used
for a process containing eight virtual pages on disk. Assume the frames are
initially empty. At the start of the program, the user should be asked to
choose
a page replacement algorithm from FIFO and LRU. On each cycle, read the
number of the referenced page and display a list of pages residing in the
frames. Also run the program with an equal-length sequence of numbers, each
being chosen randomly from the uniform distribution 0…7. Briefly discuss
the two results of using FIFO and LRU.
Can any one write for me program just part (d) in java language.
thanks in advance.
bina
-
Re: operating system program in java
I doubt any one will do your home work for you. you got to have a go and ask
specific questions here if you have any problems, there will be many people
willing to help.
Ako
"bina" <syedaferdous@hotmail.com> wrote:
>
>
>1. A process contains eight virtual pages on disk and is assigned a fixed
>allocation of
>four page frames in main memory. The following page trace occurs:
>1, 0, 2, 2, 1, 7, 6, 0, 1, 2, 0, 3, 0, 4, 5, 1, 5, 2, 4, 5, 6, 7, 2, 4,
2,
>7, 3, 3, 2, 3
>a. Show the successive pages residing in the four frames using the LRU
>replacement algorithm. Compute the hit ratio in main memory. Assume the
>frames are initially empty.
>b. Repeat part (a) for the FIFO replacement policy.
>c. Explain why the differences between the two ratios in part (a) and part
>(b).
>
>d. Write a program (e.g. using Java) to simulate part (a) and part (b).
That
>is, to
>simulate that a fixed allocation of four page frames in main memory is used
>for a process containing eight virtual pages on disk. Assume the frames
are
>initially empty. At the start of the program, the user should be asked to
>choose
>a page replacement algorithm from FIFO and LRU. On each cycle, read the
>number of the referenced page and display a list of pages residing in the
>frames. Also run the program with an equal-length sequence of numbers, each
>being chosen randomly from the uniform distribution 0…7. Briefly discuss
>the two results of using FIFO and LRU.
>
>Can any one write for me program just part (d) in java language.
>thanks in advance.
>bina
-
Re: operating system program in java
for those of you who would be able to answer this question...i'll ask this.
on a WinNT system how can my user program specify the memory working set
size for my process? i thought this is an operation of the underlying operation
system to determine the working set size for a process. i didn't think it
was possible for my user mode program to specify to the kernel the granularity
of the number of pages allocated for the process.
Note, i'm not referring to the java vm's ability to set the min/max hint
for initial memory allocation.
cheers,
mike
"bina" <syedaferdous@hotmail.com> wrote:
>
>
>1. A process contains eight virtual pages on disk and is assigned a fixed
>allocation of
>four page frames in main memory. The following page trace occurs:
>1, 0, 2, 2, 1, 7, 6, 0, 1, 2, 0, 3, 0, 4, 5, 1, 5, 2, 4, 5, 6, 7, 2, 4,
2,
>7, 3, 3, 2, 3
>a. Show the successive pages residing in the four frames using the LRU
>replacement algorithm. Compute the hit ratio in main memory. Assume the
>frames are initially empty.
>b. Repeat part (a) for the FIFO replacement policy.
>c. Explain why the differences between the two ratios in part (a) and part
>(b).
>
>d. Write a program (e.g. using Java) to simulate part (a) and part (b).
That
>is, to
>simulate that a fixed allocation of four page frames in main memory is used
>for a process containing eight virtual pages on disk. Assume the frames
are
>initially empty. At the start of the program, the user should be asked to
>choose
>a page replacement algorithm from FIFO and LRU. On each cycle, read the
>number of the referenced page and display a list of pages residing in the
>frames. Also run the program with an equal-length sequence of numbers, each
>being chosen randomly from the uniform distribution 0…7. Briefly discuss
>the two results of using FIFO and LRU.
>
>Can any one write for me program just part (d) in java language.
>thanks in advance.
>bina
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks