Wednesday, January 16, 2008

assignment#4

1. What are the major difference between deadlock, starvation, and race?

Deadlock
describes a situation where two or more threads are blocked forever, waiting for each other
Starvation is the result of conservative allocation of resources which a single job is prevented from execution because its kept waiting for resources that never become available.
Race is a synchronization problem between two processes vying for the same resource.

2. real life examples of deadlock, starvation and race.

Deadlock: When two basketball player are about to shoot in one basket in a practice game.
Starvation: When a person suitoring a girl while the girl has a boyfriend already.

Race: When two girls have the same boyfriend.

3. Four necessary condition needed for the deadlock from exercise #2:
if the product is only one.
if the two person needed that one product urgently.
if there's other alternative products available.
if the two person are brand conscious and the product happen to be what they like.
4.


5. figure 5.16 shows a tunnel going trough a mountain and two streets parallel to each other- one at each intrance/exit of the tunnel. Traffic light are located at each end of the tunnel to control the crossflow of tghe traffic through each intersection.
a. Deadlock will not happen because there are two traffic lights that control the traffic.The deadlock may when some of the motorist dont follow the traffic light because there's only one bridge to drive through.
b. Deadlock can be detected when there will be a huge bumper to bumper to the traffic and there will be accident that will happen.
c. The solution to prevent deadlock is that, the traffic lights should be accurate and motorist should follow it. In order to have a nice driving through the bridge.

6. Based on figure 5.17 answer the following question.
a. is this system deadlock?
-this is an deadlock because P2 still requesting or waitng for R1 that has already been allocated.

Thursday, December 13, 2007

assignment 3

page 56
Multiprogramming.
Why is it used?Multiprogramming is the technique of running several programs at a time using timesharing. It allows a computer to do several things at the same time. Multiprogramming creates logical parallelism. The concept of multiprogramming is that the operating system keeps several jobs in memory simultaneously. The operating system selects a job from the job pool and starts executing a job, when that job needs to wait for any i/o operations the CPU is switched to another job. So the main idea here is that the CPU is never idle.
Internal Fragmentation.How does it occur? Internal fragmentation is the space wasted inside of allocated memory blocks because of restriction on the allowed sizes of allocated blocks. Allocated memory may be slightly larger than requested memory; this size difference is memory internal to a partition, but not being used
Compaction: Why is it need?
Compaction is very needed because it is the process of collecting fragments of available memory space into contiguous in block by moving programs and data in a computer's memory disks, or known as garbage collection.
Relocation: How often should it performed? It depend on the process of address refferences in program.
#2. Describe the Major Disadvantages for each of the four memory allocation schemes presented in the chapter. The disadvantage of this memory allocation its an overhead process, so that while compaction is being done everything else must wait.
#3.Describe the Major Advantages for each of the memory alloatiuon schemes presented in the chapter. They could be divided into segments of variable sizes of equal size. Each page, or segment, could be stored wherever there was an empty block best enough to hold it


page 104
Exercises:#4
What is the cause of thrashing?
Thrashing is caused by under allocation of the minimum number of pages required by a process, forcing it to continuously page fault.
B:How does the operating system detect thrashing?
The system can detect thrashing by evaluating the level of CPU utilization as compared to the level of multiprogramming.
C:Once thrashing is detcted, what can the operating system do to iliminate it?
It can be eliminated by reducing the level of multiprogramming.

#5

What purpose does the referenced bit serve in a demand paging system?
The main idea here was to have the operation system maintain its own array of reference bits (that's the easy part) the tricky part is that the OS must somehow learn about the accesses made to pages. The best way to do this was to mark pages as invalid so that an access to the page causes a trap to the OS, which can do the bookkeeping (of course, the OS must keep extra information around to be able to tell which page table entries are truly invalid). The clock algorithm could reset the invalid bit when it checked an accessed page. The extra costs are additional traps to the OS just for normal references (depend on how fast your clock moves) and extra complexity in the OS.

Monday, December 10, 2007

Assignment # 2

Windows Operating System;

The Windows NT Virtual Memory ManagerIn Windows NT, responsibility for managing the relationship between the virtual organization of memory (as seen by applications) with the physical organization of memory (as seen by the operating system) falls on a component of the Windows NT executive called the virtual memory (VM) manager .Memory Management GoalsWindows NT is a portable, secure, multithreaded, multiprocessing operating system. As a result, its virtual memory manager must:• Be compatible with multiple processor types • Protect the NT Executive from applications • Protect applications from each other • Provide mechanisms for programs to efficiently share physical memory (RAM). • Be efficientAn Application's View of MemoryIn Windows NT, applications access memory using a 32-bit linear addressing scheme. This scheme is sometimes referred to as flat memory model because applications view memory as one linear (or flat) array of memory locations. Applications address memory using simple 32-bit offsets from address zero (0). Since a 32-bit offset can specify 232 memory addresses, each application can access up to 4 Gb of (virtual) memory. The range of addresses an application can access is called the application's address space (Figure 7).The 32-bit flat memory model makes Windows NT portable because it is compatible with the memory addressing of processors such as the MIPS R4000 and DEC Alpha. It also simplifies porting of applications originally written for flat memory model environments such as Unix and the Apple Macintosh.The flat memory model used in Windows NT contrasts sharply with the segmented model used in Windows for MS-DOS. In Windows for MS-DOS, memory is broken into many differently sized segments, each with a maximum length of 64K. This has been a major difficulty for developers of Windows applications for a very long time because changing segments is somewhat difficult and slow. This difficulty has led to many 64K limits in a lot of software, including the Windows 3.1 resource heap. The 32-bit flat memory model does away with all of these constraints.

UNIX OPERATING SYSTEM:

Most corporations have UNIX systems for handling heavy-duty applications. Microsoft Windows 2000 has been rapidly gaining ground because it provides better performance at lower cost. But companies aren't going to replace UNIX with Windows 2000—they've invested too much in their UNIX systems over the years. So many companies are choosing to add Windows 2000 to support departmental functions. It's expensive and inefficient to run two separate systems side by side so network and IT managers need to learn how to integrate Windows 2000 with their existing UNIX systems. This book shows them how to do just that and much more. The expert authors of this book approach Windows 2000 from a UNIX Systems administrator's point of view.

Tuesday, November 20, 2007

Assignment # 1

1. THE SIMPLEST EASIEST KIND OF DATABASE:
Several months ago at one of the Lima group's regular meetings, a member asked me where he could find Multiplan templates in the group's software library. Since I didn't know exactly, it was necessary to search printed directories and the commented listings of all of the 800+ disks in the library to find them all . I decided there had to be an easier way. After all, commented listings of all disks in our library, and the disk directories, are all in DV80 text files. Surely the computer could search these text files and find all references to the word Multiplan. Why not use Funnelweb's Disk Review in I(nspect) a library listing file and search that file or an entire disk of library listing files for the string "Multiplan"? Unfortunately it wasn't as easy as that.
Over the years, as I have been adding disks to the group's library I have been adding DSKU comments to the disks in both upper and lower case. A disk with Multiplan stuff may have a comment such as "All these files are Multiplan templates." Such commented listings look good and are easy to read when printed on paper, but it is hard for the computer to find all Multiplan references in such text. That is because sometimes I spelled it "MULTIPLAN", and sometimes "Multiplan". The 99/4A disk operating system doesn't know that these are both the same. Another example would be Ms Pacman vs MS PACMAN. An IBM system using MS-DOS would recognize both of these as the same. MS-DOS is not case sensitive. 99/4A DOS is case sensitive. What I should have done all along is USE ONLY UPPER CASE in our library listing text files. I will do this in the future.
I wrote the XB program below to convert existing Lima library listing files into all upper case. Put as many of these all upper case files as you can on a disk or ramdisk. Using Funnelweb's Disk Review bring up a disk directory, press I, select DISK SEARCH, choose ASCII, and then type an upper case key word or text string you want to look for. The computer will search THE ENTIRE DISK for this string and display each sector where the string is found. Use CTRL/N or CTRL/B to page sector display foreward or backwards until you see the name or number of the disk that contains your software.
Members of the Lima UG can request these ALL UPPER CASE DV80 library listings by sending the equivalent 12 DSSD disks and a paid return mailer to the group's mailing address.
This sort of text file data base has many uses. For example, if you have a large collection of music CDs tapes and phonograph records you may have trouble trying to find one particular song on all this media. Just take any TI Writer-like word processor, such as Funnelweb, and use all upper case to enter each tape or CD titile, artist, and all the songs. Use any format you want such as putting all the information for one CD/tape in a separate paragraph. Save these data files to disk as ordinary text files. When you want to find all the references to a particular song use F(ind) S(tring) from within the word processor to search a single text file, or I(nspect) from within Funnelweb's Disk Review to search a whole disk of files. It is easy and fast since the searches are at assembly language speed.
.NF .NA 50 REM SAVE DSK6.UPPERCASE 60 REM Converts all LOWER CASE of DV80 file to UPPER CASE. 70 REM Resulting ALL UPPER CASE text can easily be 80 REM searched for text strings by sector editors. 90 ON ERROR 100 100 CALL CLEAR 110 DISPLAY AT(3,2):"CONVERT DV80 TO UPPER CASE" 120 INPUT "Enter OUTPUT FILE path ":OUTPUTFILE$ 130 INPUT "Enter INPUT FILE path ":INPUTFILE$ 140 OPEN #1:INPUTFILE$,INPUT 150 OPEN #2:OUTPUTFILE$,APPEND 160 LINPUT #1:TEXT$ 170 PRINT TEXT$ :: PRINT 180 FOR T=1 TO LEN(TEXT$) 190 A=ASC(SEG$(TEXT$,T,1)):: IF A>96 THEN A=A-32 200 B$=B$&CHR$(A) 210 NEXT T 220 PRINT #2:B$ :: B$="" 240 IF EOF(1)THEN 260 250 GOTO 160 260 CLOSE #1 270 CLOSE #2 280 GOTO 100 .PL 1
2.An regional bank might decide to buy six server computers instead of one supercomputer because:
A regional bank need six server computer rather than a supercomputer because a supercomputer is only use in military and weather forecasting.
A regional bank need six server computer because they need more computers to make thier work faster.