Monday, January 21, 2008

1. Deadlock a problem occuring when the resources needed by some jobs to finish execution are held by other jobs , which, in turn, are waiting for other resources to become available. Also called deadly embrace. Starvation the result of conservative allocation of resources in which a single job is prevented from execution because it's kept waiting for resources that never become available. Race a synchronization problem between two processes vying for the same resource.
2. *Deadlock example - a traffic cituation of vehicles in a highway.
*Starvation example - a cituation in a dining table with one food served to 5 people using 5 utensils only but 2 utensils each. This results to the starvation of some people.
*Race example - a cituation that has a competition between 2 persons for only one source of food.
3. Four Necessary Conditions for Deadlock: The presence of deadlock in a systems is characterized by these four necessary conditions. The term necessary means that if there is deadlock then all four must be present.a. Mutual exclusive resource access - A resource acquired is held exclusively, i.e., it is not shared by other processes.b. No preemption - A process' resources cannot be taken away from it. Only the process can give up its resources.c. Hold and Wait - A process has some resources and is blocked requesting more.d. Circularity - This means that there is a circular chain of two or more processes in which the resources needed by one process are held by the next process.
4. Algorithm for prevention of deadlock and starvation: public boolean tryAcquire( int n0, int n1, ... ) { if ( for all i: ni ≤ availi ) { // successful acquisition availi -= ni for all i; return true; // indicate success } else return false; // indicate failure}init) Semaphore s = new Semaphore(1,1);Thread A Thread B-------- --------s.acquire(1,0); s.acquire(0,1);s.acquire(0,1); s.acquire(1,0);Thread B--------while(true) {s.acquire(0,1);if ( s.tryAcquire(1,0) ) // if second acquisition succeedsbreak; // leave the loopelse {s.release(0,1); // release what is heldsleep( SOME_AMOUNT); // pause a bit before trying again}}run action s.value--- ------ -------(1,1)A s.acquire(1,0) (0,1)B s.acquire(0,1) (0,0)A s.acquire(0,1) A blocks on secondB s.tryAcquire(1,0) => falseB s.release(0,1) (0,1)A s.acquire(0,1) (0,0) A succeeds on second.
5. a. Based on the figure, deadlock may occur.It can be happen when traffic controllers who control the traffic lights will be out of control that may result to a traffic or in a computer environment, a deadlock.
b. It can be detected if cars passing on both roads are stock that they cannot move.
c. To prevent a deadlock, traffic controllers must asure the controls of the traffic lights to be clear and fine.
6. a. This is not a deadlocked.
b. There is no blocked processes.
c. P2 can freely request on R1 and R2.
d. P1 can freely request on R1 and R2.
e. Both P1 and P2 have requested R2.1. P1 will wait after the request of P2.2. P2 will wait after the request of P1.


by: kurt enanoria

Monday, January 14, 2008

Current literature for the name of the first operating system to power an electronic computer.

Mac OS as well as Mac OS X, Apple's more recent operating system. See the Mac OS X article for information directly relating to this current Macintosh operating system.


Mac OS is the trademarked name for a series of graphical user interface-based operating systems developed by Apple Inc. (formerly Apple Computer, Inc.) for their Macintosh line of computer systems. The Macintosh user experience is credited with popularizing the graphical user interface. The original form of what Apple would later name the "Mac OS" was the integral and unnamed system software first introduced in 1984 with the original Macintosh, usually referred to simply as the System software.
Apple deliberately downplayed the existence of the operating system in the early years of the Macintosh to help make the machine appear more
user-friendly and to distance it from other operating systems such as MS-DOS, which were portrayed as arcane and technically challenging. Much of this early system software was held in ROM, with updates typically provided free of charge by Apple dealers on floppy disk. As increasing disk storage capacity and performance gradually eliminated the need for fixing much of an advanced GUI operating system in ROM, Apple explored cloning while positioning major operating system upgrades as separate revenue-generating products, first with System 7 and System 7.5, then with Mac OS 7.6 in 1997.


From Wikipedia, the free encyclopedia(Redirected from Macintosh operating system)

Thursday, December 13, 2007

Linux Memory Management

OverCommitAccounting
The Linux kernel supports the following overcommit handling modes.

Mode
Behaviour




0
Heuristic overcommit handling. Obvious overcommits of address space are refused. Used for a typical system. It ensures a seriously wild allocation fails while allowing overcommit to reduce swap usage. root is allowed to allocate slighly more memory in this mode. This is the default.

1
Always overcommit. Appropriate for some scientific applications.

2
Don't overcommit. The total address space commit for the system is not permitted to exceed swap + a configurable percentage (default is 50) of physical RAM. Depending on the percentage you use, in most situations this means a process will not be killed while accessing pages but will receive errors on memory allocation as appropriate.


The overcommit policy is set via the sysctl `vm.overcommit_memory'.

The overcommit percentage is set via `vm.overcommit_ratio'.

The current overcommit limit and amount committed are viewable in /proc/meminfo as CommitLimit and Committed_AS respectively.


Gotchas
The C language stack growth does an implicit mremap. If you want absolute guarantees and run close to the edge you MUST mmap your stack for the largest size you think you will need. For typical stack usage this does not matter much but it's a corner case if you really really care
In mode 2 the MAP_NORESERVE flag is ignored.

How It Works
The overcommit is based on the following rules:

For a file backed map
SHARED or READ-only - 0 cost (the file is the map not swap)
PRIVATE WRITABLE - size of mapping per instance
For an anonymous or /dev/zero map
SHARED - size of mapping
PRIVATE READ-only - 0 cost (but of little use)
PRIVATE WRITABLE - size of mapping per instance
Additional accounting
Pages made writable copies by mmap
shmfs memory drawn from the same pool

Status
We account mmap memory mappings
We account mprotect changes in commit
We account mremap changes in size
We account brk
We account munmap
We report the commit status in /proc
Account and check on fork
Review stack handling/building on exec
SHMfs accounting
Implement actual limit enforcement

To Do
Account ptrace pages (this is hard)

Friday, November 30, 2007

Windows Virtual Memory
For Microsoft Windows, creation and management of virtual memory files (called "paging files") are handled more or less automatically. You can, however, adjust the initial and maximum size of the paging file for a given disk. Consult your system documentation for details and instructions on how to perform these operations


UNIX Virtual Memory
For UNIX, The size of the swapping area(s) determines how much virtual memory your process is allowed. To increase the amount of available virtual memory, you must increase the size of the swap device (sometimes called the swap partition). Increasing the size of a swap partition is a time-consuming task that should be planned carefully. It usually requires saving the contents of the disk, reformatting the disk with the new file partition sizes, and restoring the original contents.Some systems offer the alternative of swapping to a regular file. This is a considerably easier solution, although it may not be as efficient. Consult your system documentation for details and instructions on how to perform these operations.
Efficiency:
Unix offers more performance at 1000MB than Windows NT offers at 2000MB. Unix is usually more proficient in the use of its memory, especially when dealing with network services. Because Unix requires less memory and processor time than Windows NT, a Unix based system has more memory and processor power for other computer functions.
Performance:
With Unix and Windows NT running on standard PC's, Unix ran 27% faster than Windows NT when reading static HTML content, and with API generated content, Unix is between 47% and 197% faster. For CGI contents, Unix is 77% faster than Windows NT.
Internet Services:
Unix has included things such as SMTP (Email), NNTP (News), Telnet, and DNS. All of these protocols and services were somehow forgotten by Windows NT. They can be covered up with third party products and Microsoft's own programs. However, none of these programs and products can compare to Unix in terms of flexibility and power.
Price Comparison:
With the Unix server's cost at approximately one fourth that of the Windows NT, it allows us to provide you with a more cost effective and powerful way to be on the Internet.
Windows or Unix page fault?
Windows XP, 2000 and even NT now outnumber Unix variants in terms of numbers shipped, although that's hardly surprising when you consider that millions of businesses worldwide have moved up to a Microsoft server system from almost nothing. That is - they've upgraded to a client/server system from a simple setup of PCs around an office which either weren't networked at all, or which were only networked via a loosely organised MS "peer to peer" network configuration.
For these sorts of businesses, installing one or more Microsoft servers would be a major step forward. And XP/W2K/NT (and their applications) have the obvious advantage of having fully-blown, comprehensive menu-driven interfaces that look (at first glance) fairly easy and user-friendly. All in all, it's a setup that comes across as a "nice, safe, and solid" option for the average small organisation that needs centralised Internet access onto a LAN.
The operating system that you use on your desktop computer (the vast majority of people use some flavor of Windows) has absolutely nothing to do with the one that your host needs to serve your web site. Most personal sites are created with MS FrontPage and even although that is a Microsoft product, it can be hosted perfectly on a UNIX web server with FrontPage Extensions installed.
Here are some important comparative features that help you determine the kind of hosting required for your website.
Stability:
UNIX systems (we actually use Linux but for comparison purposes they are identical) are the hands-down winner in this category. There are many factors leading to this, to name a few:
UNIX handles high server loads better than Windows
UNIX machines seldom require reboots while Windows is constantly in need of the same.
Servers running on UNIX enjoy extremely high up-time and high availability/reliability
Performance:
Though there is some debate about which operating system performs better, in our experience
Both perform comparably well in low-stress conditions
UNIX servers are superior to Windows under high load (which is what is more important)
Scalability:
Web sites usually change over time, with most of them starting off small and growing with the increasing needs of the person or organization running them. While both platforms can often adapt to your growing needs,
Windows hosting is more easily made compatible with UNIX-based programming features like .
Compatibility:
Web sites that are designed and programmed to be served under a UNIX-based web server can easily be hosted on a Windows server, whereas the reverse is not always true. This makes programming for UNIX the better choice.
Conclusion:
To sum it up,
The UNIX-based web hosting is more stable, performs faster and more compatible than Windows-based hosting.
You only need Windows hosting if you are going to develop a website in .NET or Visual Basic, or any other application that limits your options.

Wednesday, November 21, 2007

2.] Two Reasons why a regional bank might decide to buy six server computers instead of one supercomputer:

  • can save money
  • can at least backup for their important files from the other computers while other computers needs maintenance.

1.]The Inevitable Future of Our Operating Systems

Decade after decade, year after year, quarter after quarter: the latest technological inventions continue to taunt the world's starvation for even newer and better. We think computers. Indeed, numerous components create the computer; but what do you come home to, to look at, to feel, and to experience? Simply put: the operating systems' GUIs and subsidiary applications. Microsoft's Windows has no doubt been the towering force in the consumer operating system market for quite some time: primarily due to its newbie-friendly ease of installation and its simplicity of use among the average person. Now, if we were to compare Windows to the growing minority (ie. Linux, MacOS), we wouldn't have as much complexity on our hands as we used to.If we were to say Windows has implemented a multitude of server- side features into their newest corporate operating systems and drastically increased stability, to measure up to Linux; then we could also have to say that the MacOS has fruited up their GUI to measure up to Windows XP; or we could state the offspring of Linux, LindowsOS, has had a barely-successful run at merging both Linux and Windows together. GUI's are becoming more user-friendly, being crammed with dancing paperclips and pretty little scroll bars: eye candy. Microsoft has (for a long time) been creating applications for Apple's MacOS and they've grown on some of Apple's technology; one thing I've noticed is the silent adaptation of the scorching new FireWire. MacOS has developed their own music distribution service, Linux has - well - Linux has been Linux: don't we see where this is going? Operating systems are gradually becoming more alike, succumbing to the fellow media and its rivals, usurped by standards: some good, some bad. Believe it or not, the death of Windows was declared quite some time ago, and who knows what revelation awoke it from its slumber? After the release of Microsoft Windows 3.1, Bill Gates, past CEO and president of Microsoft, decided to halt all further labor on the Windows operating system. He essentially stated: "Enough. After Windows 3.1 we're starting something new, a new platform must be prepared." Obviously, this didn't come to pass. The triumph of Windows and its subsequent revisions were unrivaled in sales by any other operating system of the decade in the consumer market. Windows, Linux, MacOS, LindowsOS, FreeBSD: so many operating systems, so many diverse futures. As the new wave of 64-bit processors take over (with their multi-platform support, reverse compatibility mode and blazing speeds), we will see our beloved operating systems build upon themselves, synchronized with the development of the 64-bit processor. Microsoft has already finished most of its coding efforts on the new Windows 64-bit platform; Apple has already demonstrated their MacOS running beautifully on their new G5 machines with their own new wider-bus procs.Sure, we've doubled our bus size and ignited true supercomputer possibilities, but as previously stated, our operating systems must continue to grow as well. Microsoft has already released the names of their future operating systems: Windows Longhorn, followed by Windows Blackcomb. Sure, we may not fully know what they're about yet: but to declare two completely different revisions, with their own platform and new names, well. that's a lot to promise.The future for both our operating systems and processors look bright: with endless possibilities and a plethora of brilliant minds: creating brilliant technology to influence it all. Technology on this earth sure has its stones to walk and its sunsets to see, but it is emerging at an enormous rate: overestimated by too many.
Source: http://www.thetechlounge.com/